diff --git a/.drone.yml b/.drone.yml deleted file mode 100644 index 19602902..00000000 --- a/.drone.yml +++ /dev/null @@ -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: 'Foodsoft hosted by local-it e,V,.' - 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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..f2a26b4c --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Fixes line endings for Windows (Docker) environment, which are by default converted to crlf +* text=auto +*.sh text eol=lf +proc-start text eol=lf +Rakefile text eol=lf diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 34b5ce06..fbfe268f 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -15,7 +15,7 @@ jobs: MYSQL_DATABASE: test MYSQL_ROOT_PASSWORD: password options: >- - --health-cmd "mysqladmin ping" + --health-cmd "mariadb-admin ping" --health-interval 10s --health-timeout 5s --health-retries 5 @@ -35,7 +35,9 @@ jobs: - name: Checkout source code uses: actions/checkout@v2 - name: Setup chromedriver - uses: nanasess/setup-chromedriver@v1.0.1 + uses: nanasess/setup-chromedriver@v2 + with: + chromedriver-version: '115.0.5790.170' # https://github.com/nanasess/setup-chromedriver/issues/200 - name: Setup ruby uses: ruby/setup-ruby@v1 with: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 1d3cd010..cbbec263 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,297 +1,310 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2022-10-08 12:00:00 UTC using RuboCop version 1.36.0. +# on 2023-05-26 14:15:44 UTC using RuboCop version 1.50.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 28 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include. -# Include: **/*.gemfile, **/Gemfile, **/gems.rb -Bundler/OrderedGems: +# Offense count: 2 +# Configuration parameters: EnforcedStyle, AllowedGems, Include. +# SupportedStyles: Gemfile, gems.rb, gemspec +# Include: **/*.gemspec, **/Gemfile, **/gems.rb +Gemspec/DevelopmentDependencies: Exclude: - - "Gemfile" + - 'plugins/messages/foodsoft_messages.gemspec' + - 'plugins/wiki/foodsoft_wiki.gemspec' # Offense count: 9 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Include. -# Include: **/*.gemspec -Gemspec/RequireMFA: - Exclude: - - "plugins/current_orders/foodsoft_current_orders.gemspec" - - "plugins/discourse/foodsoft_discourse.gemspec" - - "plugins/documents/foodsoft_documents.gemspec" - - "plugins/links/foodsoft_links.gemspec" - - "plugins/messages/foodsoft_messages.gemspec" - - "plugins/polls/foodsoft_polls.gemspec" - - "plugins/printer/foodsoft_printer.gemspec" - - "plugins/uservoice/foodsoft_uservoice.gemspec" - - "plugins/wiki/foodsoft_wiki.gemspec" - -# Offense count: 9 -# Configuration parameters: Include. +# Configuration parameters: Severity, Include. # Include: **/*.gemspec Gemspec/RequiredRubyVersion: Exclude: - - "plugins/current_orders/foodsoft_current_orders.gemspec" - - "plugins/discourse/foodsoft_discourse.gemspec" - - "plugins/documents/foodsoft_documents.gemspec" - - "plugins/links/foodsoft_links.gemspec" - - "plugins/messages/foodsoft_messages.gemspec" - - "plugins/polls/foodsoft_polls.gemspec" - - "plugins/printer/foodsoft_printer.gemspec" - - "plugins/uservoice/foodsoft_uservoice.gemspec" - - "plugins/wiki/foodsoft_wiki.gemspec" + - 'plugins/current_orders/foodsoft_current_orders.gemspec' + - 'plugins/discourse/foodsoft_discourse.gemspec' + - 'plugins/documents/foodsoft_documents.gemspec' + - 'plugins/links/foodsoft_links.gemspec' + - 'plugins/messages/foodsoft_messages.gemspec' + - 'plugins/polls/foodsoft_polls.gemspec' + - 'plugins/printer/foodsoft_printer.gemspec' + - 'plugins/uservoice/foodsoft_uservoice.gemspec' + - 'plugins/wiki/foodsoft_wiki.gemspec' -# Offense count: 8 -# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. -Lint/AmbiguousBlockAssociation: - Exclude: - - "lib/foodsoft/expansion_variables.rb" - - "spec/api/v1/user/financial_transactions_spec.rb" - - "spec/api/v1/user/group_order_articles_spec.rb" - - "spec/models/article_spec.rb" - -# Offense count: 4 +# Offense count: 12 # This cop supports safe autocorrection (--autocorrect). -Lint/AmbiguousOperatorPrecedence: +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: with_first_argument, with_fixed_indentation +Layout/ArgumentAlignment: Exclude: - - "app/models/concerns/price_calculation.rb" - - "db/seeds/seed_helper.rb" - - "plugins/messages/app/mail_receivers/messages_mail_receiver.rb" - - "plugins/wiki/app/helpers/pages_helper.rb" + - 'app/controllers/articles_controller.rb' + - 'app/models/ordergroup.rb' + - 'config/initializers/currency_display.rb' + - 'db/migrate/001_create_users.rb' + - 'db/migrate/002_create_groups.rb' + - 'db/migrate/008_create_orders.rb' + - 'plugins/current_orders/app/helpers/current_orders_helper.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleAlignWith. +# SupportedStylesAlignWith: either, start_of_block, start_of_line +Layout/BlockAlignment: + Exclude: + - 'app/lib/foodsoft_config.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/BlockEndNewline: + Exclude: + - 'app/lib/foodsoft_config.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/ClosingParenthesisIndentation: + Exclude: + - 'app/controllers/concerns/auth.rb' # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). -Lint/AmbiguousRegexpLiteral: +Layout/EmptyLineAfterGuardClause: Exclude: - - "app/models/article_category.rb" - - "lib/foodsoft/expansion_variables.rb" + - 'db/migrate/20130622095040_move_weekly_tasks.rb' + - 'db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb' -# Offense count: 40 +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLinesAroundMethodBody: + Exclude: + - 'db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'db/migrate/021_remove_table_article_prices.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses +Layout/FirstArgumentIndentation: + Exclude: + - 'app/controllers/concerns/auth.rb' + +# Offense count: 12 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'app/controllers/admin/ordergroups_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/documents/order_fax.rb' + - 'db/migrate/001_create_users.rb' + - 'db/migrate/002_create_groups.rb' + - 'db/migrate/008_create_orders.rb' + - 'db/migrate/20190101000000_create_active_storage_tables.active_storage.rb' + - 'spec/lib/bank_transaction_reference_spec.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: normal, indented_internal_methods +Layout/IndentationConsistency: + Exclude: + - 'db/migrate/20090120184410_road_to_version_three.rb' + - 'db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: Width, AllowedPatterns. +Layout/IndentationWidth: + Exclude: + - 'app/lib/foodsoft_config.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineMethodCallBraceLayout: + Exclude: + - 'app/controllers/concerns/auth.rb' + +# Offense count: 15 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'app/controllers/admin/ordergroups_controller.rb' + - 'app/controllers/articles_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/documents/order_fax.rb' + - 'app/models/ordergroup.rb' + - 'config/initializers/currency_display.rb' + - 'db/migrate/001_create_users.rb' + - 'db/migrate/002_create_groups.rb' + - 'db/migrate/008_create_orders.rb' + - 'db/migrate/20190101000000_create_active_storage_tables.active_storage.rb' + - 'db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb' + - 'plugins/current_orders/app/helpers/current_orders_helper.rb' + - 'spec/lib/bank_transaction_reference_spec.rb' + +# Offense count: 41 +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowSafeAssignment. Lint/AssignmentInCondition: Enabled: false -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -Lint/BigDecimalNew: - Exclude: - - "app/models/group_order.rb" - - "config/initializers/extensions.rb" - # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Lint/BooleanSymbol: Exclude: - - "app/models/delivery.rb" + - 'app/models/delivery.rb' -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Lint/DeprecatedClassMethods: - Exclude: - - "config/initializers/secret_token.rb" - - "lib/tasks/foodsoft_setup.rake" - -# Offense count: 3 +# Offense count: 4 # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. Lint/DuplicateBranch: Exclude: - - "app/controllers/concerns/auth_api.rb" - - "app/controllers/orders_controller.rb" + - 'app/controllers/concerns/auth_api.rb' + - 'app/controllers/orders_controller.rb' + - 'plugins/wiki/app/controllers/pages_controller.rb' # Offense count: 3 Lint/DuplicateMethods: Exclude: - - "app/models/invoice.rb" - - "plugins/messages/app/models/message.rb" + - 'app/models/invoice.rb' + - 'plugins/messages/app/models/message.rb' # Offense count: 2 # Configuration parameters: AllowComments, AllowEmptyLambdas. Lint/EmptyBlock: Exclude: - - "spec/factories/group_order_article.rb" - - "spec/factories/group_order_article_quantity.rb" + - 'spec/factories/group_order_article.rb' + - 'spec/factories/group_order_article_quantity.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Lint/EnsureReturn: Exclude: - - "app/controllers/finance/bank_accounts_controller.rb" + - 'app/controllers/finance/bank_accounts_controller.rb' -# Offense count: 2 +# Offense count: 1 Lint/IneffectiveAccessModifier: Exclude: - - "lib/foodsoft_mail_receiver.rb" - - "lib/token_verifier.rb" + - 'app/lib/foodsoft_mail_receiver.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Lint/Loop: Exclude: - - "app/models/concerns/mark_as_deleted_with_name.rb" + - 'app/models/concerns/mark_as_deleted_with_name.rb' # Offense count: 2 Lint/MixedRegexpCaptureTypes: Exclude: - - "lib/bank_transaction_reference.rb" - - "lib/foodsoft_mail_receiver.rb" + - 'app/lib/bank_transaction_reference.rb' + - 'app/lib/foodsoft_mail_receiver.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Lint/NonDeterministicRequireOrder: Exclude: - - "spec/spec_helper.rb" + - 'spec/spec_helper.rb' # Offense count: 1 Lint/ReturnInVoidContext: Exclude: - - "lib/foodsoft_config.rb" - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -Lint/SendWithMixinArgument: - Exclude: - - "plugins/discourse/lib/foodsoft_discourse/redirect_to_login.rb" - - "plugins/messages/lib/foodsoft_messages/user_link.rb" - - "plugins/uservoice/lib/foodsoft_uservoice.rb" - - "plugins/wiki/lib/foodsoft_wiki/mailer.rb" + - 'app/lib/foodsoft_config.rb' # Offense count: 1 # Configuration parameters: IgnoreImplicitReferences. Lint/ShadowedArgument: Exclude: - - "app/helpers/deliveries_helper.rb" + - 'app/helpers/deliveries_helper.rb' -# Offense count: 8 +# Offense count: 6 Lint/ShadowingOuterLocalVariable: Exclude: - - "app/documents/order_matrix.rb" - - "app/helpers/group_orders_helper.rb" - - "app/models/group_order.rb" - - "app/models/group_order_article.rb" - - "plugins/discourse/app/controllers/discourse_login_controller.rb" - - "plugins/polls/app/controllers/polls_controller.rb" - - "spec/integration/config_spec.rb" + - 'app/documents/order_matrix.rb' + - 'app/helpers/group_orders_helper.rb' + - 'app/models/group_order.rb' + - 'app/models/group_order_article.rb' + - 'plugins/discourse/app/controllers/discourse_login_controller.rb' + - 'plugins/polls/app/controllers/polls_controller.rb' -# Offense count: 3 +# Offense count: 2 # Configuration parameters: AllowComments, AllowNil. Lint/SuppressedException: Exclude: - - "config/initializers/rails6_backports.rb" - - "lib/foodsoft_config.rb" - - "lib/tasks/rspec.rake" + - 'app/lib/foodsoft_config.rb' + - 'lib/tasks/rspec.rake' # Offense count: 1 # Configuration parameters: AllowKeywordBlockArguments. Lint/UnderscorePrefixedVariableName: Exclude: - - "app/models/order_article.rb" - -# Offense count: 16 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: IgnoreEmptyBlocks, AllowUnusedKeywordArguments. -Lint/UnusedBlockArgument: - Exclude: - - "app/models/article.rb" - - "app/models/group_order.rb" - - "config/initializers/exception_notification.rb" - - "plugins/printer/lib/foodsoft_printer/engine.rb" - - "plugins/uservoice/lib/foodsoft_uservoice.rb" - - "plugins/wiki/lib/foodsoft_wiki/wiki_parser.rb" - - "spec/factories/supplier.rb" - - "spec/factories/user.rb" - - "spec/integration/config_spec.rb" - - "spec/models/article_spec.rb" - -# Offense count: 23 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods. -Lint/UnusedMethodArgument: - Exclude: - - "app/controllers/api/v1/base_controller.rb" - - "app/controllers/concerns/foodcoop_scope.rb" - - "app/helpers/application_helper.rb" - - "app/models/article.rb" - - "app/models/article_category.rb" - - "app/models/financial_transaction.rb" - - "app/models/group_order.rb" - - "app/models/group_order_article.rb" - - "app/models/order.rb" - - "app/models/order_article.rb" - - "app/models/supplier.rb" - - "lib/foodsoft_mail_receiver.rb" - - "lib/order_txt.rb" - - "lib/render_pdf.rb" - - "plugins/wiki/lib/foodsoft_wiki/mailer.rb" - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: ContextCreatingMethods, MethodCreatingMethods. -Lint/UselessAccessModifier: - Exclude: - - "lib/token_verifier.rb" - - "plugins/messages/app/models/messagegroup.rb" + - 'app/models/order_article.rb' # Offense count: 14 Lint/UselessAssignment: Exclude: - - "app/controllers/admin/ordergroups_controller.rb" - - "app/helpers/admin/configs_helper.rb" - - "app/inputs/date_picker_time_input.rb" - - "app/models/order_article.rb" - - "db/migrate/003_create_suppliers.rb" - - "db/migrate/004_create_article_meta.rb" - - "db/migrate/005_create_financial_transactions.rb" - - "db/migrate/008_create_orders.rb" - - "db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb" - - "plugins/current_orders/app/documents/multiple_orders_by_articles.rb" - - "plugins/current_orders/app/documents/multiple_orders_by_groups.rb" - - "spec/lib/foodsoft_config_spec.rb" + - 'app/controllers/admin/ordergroups_controller.rb' + - 'app/helpers/admin/configs_helper.rb' + - 'app/inputs/date_picker_time_input.rb' + - 'app/models/order_article.rb' + - 'db/migrate/003_create_suppliers.rb' + - 'db/migrate/004_create_article_meta.rb' + - 'db/migrate/005_create_financial_transactions.rb' + - 'db/migrate/008_create_orders.rb' + - 'db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb' + - 'plugins/current_orders/app/documents/multiple_orders_by_articles.rb' + - 'plugins/current_orders/app/documents/multiple_orders_by_groups.rb' + - 'spec/lib/foodsoft_config_spec.rb' # Offense count: 1 # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: - - "lib/foodsoft_config.rb" + - 'app/lib/foodsoft_config.rb' -# Offense count: 160 -# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes. +# Offense count: 161 +# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: Max: 143 -# Offense count: 17 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, inherit_mode. +# Offense count: 13 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns, inherit_mode. # AllowedMethods: refine Metrics/BlockLength: - Max: 212 + Max: 66 -# Offense count: 6 +# Offense count: 2 # Configuration parameters: CountBlocks. Metrics/BlockNesting: - Max: 5 + Max: 4 -# Offense count: 18 +# Offense count: 19 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 288 + Max: 294 -# Offense count: 52 -# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. +# Offense count: 51 +# Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/CyclomaticComplexity: - Max: 22 + Max: 20 -# Offense count: 163 -# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods. +# Offense count: 164 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: Max: 112 # Offense count: 4 # Configuration parameters: CountComments, CountAsOne. Metrics/ModuleLength: - Max: 190 + Max: 191 # Offense count: 1 # Configuration parameters: CountKeywordArgs, MaxOptionalParameters. @@ -299,47 +312,45 @@ Metrics/ParameterLists: Max: 6 # Offense count: 36 -# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. +# Configuration parameters: AllowedMethods, AllowedPatterns. Metrics/PerceivedComplexity: - Max: 23 + Max: 21 # Offense count: 6 Naming/AccessorMethodName: Exclude: - - "app/controllers/admin/configs_controller.rb" - - "lib/bank_account_connector.rb" - - "lib/foodsoft_config.rb" - - "spec/integration/config_spec.rb" + - 'app/controllers/admin/configs_controller.rb' + - 'app/lib/bank_account_connector.rb' + - 'app/lib/foodsoft_config.rb' + - 'spec/integration/config_spec.rb' # Offense count: 1 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. Naming/BlockParameterName: Exclude: - - "db/migrate/008_create_orders.rb" + - 'db/migrate/008_create_orders.rb' # Offense count: 1 # Configuration parameters: EnforcedStyleForLeadingUnderscores. # SupportedStylesForLeadingUnderscores: disallowed, required, optional Naming/MemoizedInstanceVariableName: Exclude: - - "plugins/messages/app/models/message.rb" + - 'plugins/messages/app/models/message.rb' -# Offense count: 19 +# Offense count: 16 # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. -# AllowedNames: as, at, by, db, id, in, io, ip, of, on, os, pp, to +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to Naming/MethodParameterName: Exclude: - - "app/controllers/api/v1/base_controller.rb" - - "app/controllers/api/v1/user/group_order_articles_controller.rb" - - "app/helpers/application_helper.rb" - - "app/helpers/orders_helper.rb" - - "app/models/user.rb" - - "lib/foodsoft_date_util.rb" - - "lib/render_pdf.rb" - - "spec/integration/config_spec.rb" - - "spec/integration/receive_spec.rb" - - "spec/models/order_article_spec.rb" - - "spec/support/shared_database.rb" + - 'app/controllers/api/v1/base_controller.rb' + - 'app/controllers/api/v1/user/group_order_articles_controller.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/orders_helper.rb' + - 'app/models/user.rb' + - 'spec/integration/config_spec.rb' + - 'spec/integration/receive_spec.rb' + - 'spec/models/order_article_spec.rb' + - 'spec/support/shared_database.rb' # Offense count: 11 # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. @@ -349,226 +360,156 @@ Naming/MethodParameterName: # MethodDefinitionMacros: define_method, define_singleton_method Naming/PredicateName: Exclude: - - "app/models/financial_transaction_class.rb" - - "app/models/financial_transaction_type.rb" - - "app/models/order.rb" - - "app/models/periodic_task_group.rb" - - "app/models/supplier.rb" - - "app/models/task.rb" - - "app/models/user.rb" - - "app/serializers/order_serializer.rb" - - "plugins/messages/app/models/message.rb" + - 'app/models/financial_transaction_class.rb' + - 'app/models/financial_transaction_type.rb' + - 'app/models/order.rb' + - 'app/models/periodic_task_group.rb' + - 'app/models/supplier.rb' + - 'app/models/task.rb' + - 'app/models/user.rb' + - 'app/serializers/order_serializer.rb' + - 'plugins/messages/app/models/message.rb' -# Offense count: 45 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: PreferredName. -Naming/RescuedExceptionsVariableName: - Enabled: false - -# Offense count: 22 +# Offense count: 17 # Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns. # SupportedStyles: snake_case, camelCase Naming/VariableName: Exclude: - - "app/controllers/concerns/auth.rb" - - "app/helpers/application_helper.rb" - - "db/migrate/008_create_orders.rb" - - "lib/bank_account_information_importer.rb" - -# Offense count: 23 -# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. -# SupportedStyles: snake_case, normalcase, non_integer -# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 -Naming/VariableNumber: - Exclude: - - "app/documents/order_matrix.rb" - - "spec/api/v1/swagger_spec.rb" - - "spec/api/v1/user/group_order_articles_spec.rb" - - "spec/api/v1/user/ordergroup_spec.rb" + - 'app/controllers/concerns/auth.rb' + - 'app/helpers/application_helper.rb' + - 'db/migrate/008_create_orders.rb' # Offense count: 4 -RSpec/AnyInstance: +# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns. +# SupportedStyles: snake_case, normalcase, non_integer +# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64 +Naming/VariableNumber: Exclude: - - "spec/api/v1/swagger_spec.rb" - - "spec/api/v1/user/group_order_articles_spec.rb" + - 'app/documents/order_matrix.rb' # Offense count: 2 RSpec/BeforeAfterAll: Exclude: - - "spec/lib/foodsoft_mail_receiver_spec.rb" + - 'spec/lib/foodsoft_mail_receiver_spec.rb' -# Offense count: 9 +# Offense count: 10 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnabledMethods. RSpec/Capybara/FeatureMethods: Exclude: - - "spec/integration/articles_spec.rb" - - "spec/integration/balancing_spec.rb" - - "spec/integration/config_spec.rb" - - "spec/integration/home_spec.rb" - - "spec/integration/login_spec.rb" - - "spec/integration/order_spec.rb" - - "spec/integration/product_distribution_example_spec.rb" - - "spec/integration/receive_spec.rb" - - "spec/integration/session_spec.rb" - - "spec/integration/supplier_spec.rb" + - 'spec/integration/articles_spec.rb' + - 'spec/integration/balancing_spec.rb' + - 'spec/integration/config_spec.rb' + - 'spec/integration/home_spec.rb' + - 'spec/integration/login_spec.rb' + - 'spec/integration/order_spec.rb' + - 'spec/integration/product_distribution_example_spec.rb' + - 'spec/integration/receive_spec.rb' + - 'spec/integration/session_spec.rb' + - 'spec/integration/supplier_spec.rb' # Offense count: 4 RSpec/Capybara/SpecificMatcher: Exclude: - - "spec/integration/login_spec.rb" - - "spec/integration/session_spec.rb" + - 'spec/integration/login_spec.rb' + - 'spec/integration/session_spec.rb' -# Offense count: 27 +# Offense count: 12 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without RSpec/ContextWording: Exclude: - - "spec/api/v1/swagger_spec.rb" - - "spec/api/v1/user/group_order_articles_spec.rb" - - "spec/models/order_article_spec.rb" - - "spec/models/supplier_spec.rb" + - 'spec/models/order_article_spec.rb' + - 'spec/models/supplier_spec.rb' -# Offense count: 1 +# Offense count: 7 # Configuration parameters: IgnoredMetadata. RSpec/DescribeClass: Exclude: - - "spec/api/v1/swagger_spec.rb" + - 'spec/integration/balancing_spec.rb' + - 'spec/integration/config_spec.rb' + - 'spec/integration/home_spec.rb' + - 'spec/integration/product_distribution_example_spec.rb' + - 'spec/integration/receive_spec.rb' + - 'spec/integration/session_spec.rb' + - 'spec/integration/supplier_spec.rb' -# Offense count: 126 +# Offense count: 128 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: SkipBlocks, EnforcedStyle. # SupportedStyles: described_class, explicit RSpec/DescribedClass: Exclude: - - "spec/lib/bank_transaction_reference_spec.rb" - - "spec/lib/foodsoft_config_spec.rb" - - "spec/lib/foodsoft_mail_receiver_spec.rb" - - "spec/lib/token_verifier_spec.rb" - - "spec/models/group_order_article_spec.rb" - - "spec/models/order_article_spec.rb" - - "spec/models/order_spec.rb" - - "spec/models/ordergroup_spec.rb" - - "spec/models/user_spec.rb" + - 'spec/integration/order_spec.rb' + - 'spec/lib/bank_transaction_reference_spec.rb' + - 'spec/lib/foodsoft_config_spec.rb' + - 'spec/lib/foodsoft_mail_receiver_spec.rb' + - 'spec/lib/token_verifier_spec.rb' + - 'spec/models/group_order_article_spec.rb' + - 'spec/models/order_article_spec.rb' + - 'spec/models/order_spec.rb' + - 'spec/models/ordergroup_spec.rb' + - 'spec/models/user_spec.rb' -# Offense count: 15 +# Offense count: 14 # 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' + - 'spec/requests/api/**/*_spec.rb' - - -# Offense count: 65 +# Offense count: 69 # Configuration parameters: CountAsOne. RSpec/ExampleLength: Max: 81 -# Offense count: 7 +# Offense count: 3 # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly. # Include: **/*_spec*rb*, **/spec/**/* RSpec/FilePath: Exclude: - - "spec/api/v1/order_articles_spec.rb" - - "spec/api/v1/user/financial_transactions_spec.rb" - - "spec/api/v1/user/group_order_articles_spec.rb" - - "spec/api/v1/user/ordergroup_spec.rb" - - "spec/integration/articles_spec.rb" - - "spec/integration/login_spec.rb" - - "spec/lib/bank_account_information_importer_spec.rb" - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: implicit, each, example -RSpec/HookArgument: - Exclude: - - "spec/spec_helper.rb" - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -RSpec/HooksBeforeExamples: - Exclude: - - "spec/integration/balancing_spec.rb" - - "spec/lib/foodsoft_mail_receiver_spec.rb" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: single_line_only, single_statement_only, disallow -RSpec/ImplicitSubject: - Exclude: - - "spec/api/v1/swagger_spec.rb" + - 'spec/integration/articles_spec.rb' + - 'spec/integration/login_spec.rb' + - 'spec/lib/bank_account_information_importer_spec.rb' # Offense count: 6 # Configuration parameters: AssignmentOnly. RSpec/InstanceVariable: Exclude: - - "spec/lib/foodsoft_mail_receiver_spec.rb" + - 'spec/lib/foodsoft_mail_receiver_spec.rb' -# Offense count: 2 +# Offense count: 3 RSpec/IteratedExpectation: Exclude: - - "spec/models/order_spec.rb" - - "spec/models/supplier_spec.rb" + - 'spec/models/order_spec.rb' + - 'spec/models/supplier_spec.rb' -# Offense count: 13 +# Offense count: 3 RSpec/LetSetup: Exclude: - - "spec/api/v1/swagger_spec.rb" - - "spec/api/v1/user/group_order_articles_spec.rb" - - "spec/api/v1/user/ordergroup_spec.rb" - - "spec/models/bank_transaction_spec.rb" - - "spec/models/group_order_article_spec.rb" - - "spec/models/supplier_spec.rb" + - 'spec/models/bank_transaction_spec.rb' + - 'spec/models/group_order_article_spec.rb' + - 'spec/models/supplier_spec.rb' # Offense count: 3 RSpec/MissingExampleGroupArgument: Exclude: - - "spec/models/group_order_article_spec.rb" - - "spec/models/group_order_spec.rb" - - "spec/models/user_spec.rb" + - 'spec/models/group_order_article_spec.rb' + - 'spec/models/group_order_spec.rb' + - 'spec/models/user_spec.rb' -# Offense count: 88 +# Offense count: 103 RSpec/MultipleExpectations: Max: 22 -# Offense count: 83 +# Offense count: 36 # Configuration parameters: AllowSubject. RSpec/MultipleMemoizedHelpers: - Max: 17 + Max: 15 -# Offense count: 29 +# Offense count: 8 # Configuration parameters: AllowedGroups. RSpec/NestedGroups: - Max: 6 - -# Offense count: 31 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: not_to, to_not -RSpec/NotToNot: - Exclude: - - "spec/api/v1/user/financial_transactions_spec.rb" - - "spec/api/v1/user/group_order_articles_spec.rb" - - "spec/integration/balancing_spec.rb" - - "spec/integration/login_spec.rb" - - "spec/integration/receive_spec.rb" - - "spec/integration/session_spec.rb" - - "spec/lib/token_verifier_spec.rb" - - "spec/models/article_spec.rb" - - "spec/models/order_spec.rb" - - "spec/models/supplier_spec.rb" + Max: 4 # Offense count: 8 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -576,92 +517,61 @@ RSpec/NotToNot: # SupportedStyles: inflected, explicit RSpec/PredicateMatcher: Exclude: - - "spec/models/article_spec.rb" - - "spec/models/user_spec.rb" + - 'spec/models/article_spec.rb' + - 'spec/models/user_spec.rb' # Offense count: 6 RSpec/RepeatedDescription: Exclude: - - "spec/lib/bank_account_information_importer_spec.rb" - - "spec/lib/bank_transaction_reference_spec.rb" - - "spec/lib/foodsoft_mail_receiver_spec.rb" + - 'spec/lib/bank_account_information_importer_spec.rb' + - 'spec/lib/bank_transaction_reference_spec.rb' + - 'spec/lib/foodsoft_mail_receiver_spec.rb' # Offense count: 4 RSpec/RepeatedExample: Exclude: - - "spec/lib/bank_transaction_reference_spec.rb" - - "spec/lib/foodsoft_mail_receiver_spec.rb" + - 'spec/lib/bank_transaction_reference_spec.rb' + - 'spec/lib/foodsoft_mail_receiver_spec.rb' -# Offense count: 7 +# Offense count: 5 RSpec/ScatteredSetup: Exclude: - - "spec/api/v1/user/ordergroup_spec.rb" - - "spec/integration/balancing_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$ + - 'spec/integration/balancing_spec.rb' + - 'spec/integration/login_spec.rb' # Offense count: 1 # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames. RSpec/VerifiedDoubles: Exclude: - - "spec/support/api_oauth.rb" - -# Offense count: 45 -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/ActiveRecordAliases: - Enabled: false - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Include. -# Include: app/models/**/*.rb -Rails/ActiveRecordCallbacksOrder: - Exclude: - - "app/models/financial_transaction_type.rb" - - "app/models/order.rb" - - "app/models/stock_change.rb" + - 'spec/support/api_oauth.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationMailer: Exclude: - - "app/mailers/mailer.rb" + - 'app/mailers/mailer.rb' # Offense count: 20 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/ApplicationRecord: Exclude: - - "app/models/supplier_category.rb" - - "db/migrate/20130718183101_migrate_user_settings.rb" - - "db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb" - - "db/migrate/20181201000301_change_ordergroup_default_in_financial_transaction.rb" - - "db/migrate/20181201000302_change_stock_supplier_to_null_in_order.rb" - - "db/migrate/20181201000305_ensure_article_for_article_price.rb" - - "db/migrate/20181201000400_create_supplier_categories.rb" - - "db/migrate/20181204000000_clear_invalid_invoices_from_orders.rb" - - "db/migrate/20181204070000_create_stock_events.rb" - - "plugins/messages/app/models/message_recipient.rb" - - "plugins/polls/app/models/poll.rb" - - "plugins/polls/app/models/poll_choice.rb" - - "plugins/polls/app/models/poll_vote.rb" - - "plugins/printer/app/models/printer_job.rb" - - "plugins/printer/app/models/printer_job_update.rb" + - 'app/models/supplier_category.rb' + - 'db/migrate/20130718183101_migrate_user_settings.rb' + - 'db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb' + - 'db/migrate/20181201000301_change_ordergroup_default_in_financial_transaction.rb' + - 'db/migrate/20181201000302_change_stock_supplier_to_null_in_order.rb' + - 'db/migrate/20181201000305_ensure_article_for_article_price.rb' + - 'db/migrate/20181201000400_create_supplier_categories.rb' + - 'db/migrate/20181204000000_clear_invalid_invoices_from_orders.rb' + - 'db/migrate/20181204070000_create_stock_events.rb' + - 'plugins/messages/app/models/message_recipient.rb' + - 'plugins/polls/app/models/poll.rb' + - 'plugins/polls/app/models/poll_choice.rb' + - 'plugins/polls/app/models/poll_vote.rb' + - 'plugins/printer/app/models/printer_job.rb' + - 'plugins/printer/app/models/printer_job_update.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: NilOrEmpty, NotPresent, UnlessPresent. -Rails/Blank: - Exclude: - - "app/controllers/api/v1/base_controller.rb" - -# Offense count: 34 +# Offense count: 35 # Configuration parameters: Include. # Include: db/migrate/*.rb Rails/CreateTableWithTimestamps: @@ -672,146 +582,94 @@ Rails/CreateTableWithTimestamps: # SupportedStyles: strict, flexible Rails/Date: Exclude: - - "app/controllers/deliveries_controller.rb" - - "app/documents/order_fax.rb" - - "app/models/periodic_task_group.rb" - - "spec/integration/order_spec.rb" - - "spec/models/order_spec.rb" + - 'app/controllers/deliveries_controller.rb' + - 'app/documents/order_fax.rb' + - 'app/models/periodic_task_group.rb' + - 'spec/integration/order_spec.rb' + - 'spec/models/order_spec.rb' -# Offense count: 67 +# Offense count: 68 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Whitelist, AllowedMethods, AllowedReceivers. -# Whitelist: find_by_sql -# AllowedMethods: find_by_sql -# AllowedReceivers: Gem::Specification +# Whitelist: find_by_sql, find_by_token_for +# AllowedMethods: find_by_sql, find_by_token_for +# AllowedReceivers: Gem::Specification, page Rails/DynamicFindBy: Enabled: false -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Include. -# Include: app/models/**/*.rb -Rails/EnumHash: - Exclude: - - "app/models/order.rb" - -# Offense count: 8 +# Offense count: 4 # Configuration parameters: EnforcedStyle. # SupportedStyles: slashes, arguments Rails/FilePath: Exclude: - - "config/application.rb" - - "config/initializers/secret_token.rb" - - "lib/order_txt.rb" - - "lib/render_csv.rb" - - "lib/render_pdf.rb" - - "plugins/current_orders/app/documents/multiple_orders_by_groups.rb" - - "spec/api/v1/swagger_spec.rb" - -# Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Include, AllowedMethods, AllowedPatterns, IgnoredMethods. -# Include: app/models/**/*.rb -# AllowedMethods: order, limit, select, lock -# IgnoredMethods: order, limit, select, lock -Rails/FindEach: - Exclude: - - "app/models/bank_account.rb" - - "app/models/order.rb" - - "app/models/ordergroup.rb" - - "app/models/periodic_task_group.rb" - - "app/models/task.rb" + - 'config/application.rb' + - 'config/initializers/secret_token.rb' + - 'plugins/current_orders/app/documents/multiple_orders_by_groups.rb' # Offense count: 26 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/HasManyOrHasOneDependent: Exclude: - - "app/models/article.rb" - - "app/models/article_category.rb" - - "app/models/article_price.rb" - - "app/models/financial_link.rb" - - "app/models/financial_transaction.rb" - - "app/models/group_order.rb" - - "app/models/order.rb" - - "app/models/ordergroup.rb" - - "app/models/shared_supplier.rb" - - "app/models/stock_article.rb" - - "app/models/supplier.rb" - - "app/models/supplier_category.rb" - - "app/models/user.rb" - - "app/models/workgroup.rb" + - 'app/models/article.rb' + - 'app/models/article_category.rb' + - 'app/models/article_price.rb' + - 'app/models/financial_link.rb' + - 'app/models/financial_transaction.rb' + - 'app/models/group_order.rb' + - 'app/models/order.rb' + - 'app/models/ordergroup.rb' + - 'app/models/shared_supplier.rb' + - 'app/models/stock_article.rb' + - 'app/models/supplier.rb' + - 'app/models/supplier_category.rb' + - 'app/models/user.rb' + - 'app/models/workgroup.rb' # Offense count: 14 # Configuration parameters: Include. # Include: app/helpers/**/*.rb Rails/HelperInstanceVariable: Exclude: - - "app/helpers/admin/configs_helper.rb" - - "app/helpers/application_helper.rb" - - "app/helpers/orders_helper.rb" + - 'app/helpers/admin/configs_helper.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/orders_helper.rb' -# Offense count: 14 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: numeric, symbolic -Rails/HttpStatus: - Exclude: - - "app/controllers/admin/bank_accounts_controller.rb" - - "app/controllers/admin/financial_transaction_classes_controller.rb" - - "app/controllers/admin/financial_transaction_types_controller.rb" - - "app/controllers/api/v1/base_controller.rb" - - "app/controllers/styles_controller.rb" - - "plugins/links/app/controllers/links_controller.rb" - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Rails/IndexBy: - Exclude: - - "app/models/order.rb" - - "spec/api/v1/user/ordergroup_spec.rb" - -# Offense count: 23 +# Offense count: 22 # Configuration parameters: IgnoreScopes, Include. # Include: app/models/**/*.rb Rails/InverseOf: Exclude: - - "app/models/article.rb" - - "app/models/bank_transaction.rb" - - "app/models/financial_transaction.rb" - - "app/models/group_order.rb" - - "app/models/invoice.rb" - - "app/models/mail_delivery_status.rb" - - "app/models/order.rb" - - "app/models/shared_article.rb" - - "app/models/shared_supplier.rb" - - "app/models/stock_change.rb" - - "app/models/supplier.rb" - - "app/models/task.rb" - - "app/models/user.rb" - - "app/models/workgroup.rb" + - 'app/models/article.rb' + - 'app/models/bank_transaction.rb' + - 'app/models/financial_transaction.rb' + - 'app/models/group_order.rb' + - 'app/models/invoice.rb' + - 'app/models/mail_delivery_status.rb' + - 'app/models/order.rb' + - 'app/models/shared_article.rb' + - 'app/models/shared_supplier.rb' + - 'app/models/stock_change.rb' + - 'app/models/supplier.rb' + - 'app/models/task.rb' + - 'app/models/user.rb' + - 'app/models/workgroup.rb' # Offense count: 2 # Configuration parameters: Include. # Include: app/controllers/**/*.rb, app/mailers/**/*.rb Rails/LexicallyScopedActionFilter: Exclude: - - "app/controllers/group_orders_controller.rb" - - "app/controllers/suppliers_controller.rb" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Rails/LinkToBlank: - Exclude: - - "app/helpers/application_helper.rb" + - 'app/controllers/group_orders_controller.rb' + - 'app/controllers/suppliers_controller.rb' # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/NegateInclude: Exclude: - - "app/helpers/application_helper.rb" - - "app/models/supplier.rb" - - "lib/tasks/foodsoft_setup.rake" + - 'app/helpers/application_helper.rb' + - 'app/models/supplier.rb' + - 'lib/tasks/foodsoft_setup.rake' # Offense count: 34 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -819,55 +677,36 @@ Rails/NegateInclude: # Include: app/**/*.rb, config/**/*.rb, db/**/*.rb, lib/**/*.rb Rails/Output: Exclude: - - "config/initializers/resque.rb" - - "config/initializers/secret_token.rb" - - "db/migrate/001_create_users.rb" - - "db/migrate/002_create_groups.rb" - - "db/migrate/003_create_suppliers.rb" - - "db/migrate/004_create_article_meta.rb" - - "db/migrate/005_create_financial_transactions.rb" - - "db/migrate/006_create_articles.rb" - - "db/migrate/007_create_article_prices.rb" - - "db/migrate/008_create_orders.rb" - - "db/migrate/021_remove_table_article_prices.rb" - - "db/migrate/20090120184410_road_to_version_three.rb" - - "db/migrate/20130622095040_move_weekly_tasks.rb" + - 'config/initializers/resque.rb' + - 'config/initializers/secret_token.rb' + - 'db/migrate/001_create_users.rb' + - 'db/migrate/002_create_groups.rb' + - 'db/migrate/003_create_suppliers.rb' + - 'db/migrate/004_create_article_meta.rb' + - 'db/migrate/005_create_financial_transactions.rb' + - 'db/migrate/006_create_articles.rb' + - 'db/migrate/007_create_article_prices.rb' + - 'db/migrate/008_create_orders.rb' + - 'db/migrate/021_remove_table_article_prices.rb' + - 'db/migrate/20090120184410_road_to_version_three.rb' + - 'db/migrate/20130622095040_move_weekly_tasks.rb' # Offense count: 28 Rails/OutputSafety: Exclude: - - "app/helpers/admin/configs_helper.rb" - - "app/helpers/application_helper.rb" - - "app/helpers/deliveries_helper.rb" - - "app/helpers/orders_helper.rb" - - "app/helpers/tasks_helper.rb" - - "plugins/messages/app/helpers/messages_helper.rb" - - "plugins/wiki/app/helpers/pages_helper.rb" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Rails/Pluck: - Exclude: - - "lib/ordergroups_csv.rb" - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Rails/PluralizationGrammar: - Exclude: - - "app/controllers/application_controller.rb" - - "lib/tasks/foodsoft.rake" + - 'app/helpers/admin/configs_helper.rb' + - 'app/helpers/application_helper.rb' + - 'app/helpers/deliveries_helper.rb' + - 'app/helpers/orders_helper.rb' + - 'app/helpers/tasks_helper.rb' + - 'plugins/messages/app/helpers/messages_helper.rb' + - 'plugins/wiki/app/helpers/pages_helper.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Rails/Presence: Exclude: - - "db/migrate/021_remove_table_article_prices.rb" - -# Offense count: 36 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: NotNilAndNotEmpty, NotBlank, UnlessBlank. -Rails/Present: - Enabled: false + - 'db/migrate/021_remove_table_article_prices.rb' # Offense count: 6 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -875,30 +714,34 @@ Rails/Present: # Include: **/Rakefile, **/*.rake Rails/RakeEnvironment: Exclude: - - "lib/tasks/foodsoft_setup.rake" - - "lib/tasks/resque.rake" + - 'lib/tasks/foodsoft_setup.rake' + - 'lib/tasks/resque.rake' -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -Rails/RedundantForeignKey: - Exclude: - - "app/models/financial_transaction.rb" - - "plugins/messages/app/models/message.rb" - -# Offense count: 1 +# Offense count: 14 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/RedundantPresenceValidationOnBelongsTo: Exclude: - - "app/models/financial_transaction_type.rb" + - 'app/models/article.rb' + - 'app/models/bank_transaction.rb' + - 'app/models/delivery.rb' + - 'app/models/financial_transaction.rb' + - 'app/models/financial_transaction_type.rb' + - 'app/models/group_order.rb' + - 'app/models/group_order_article.rb' + - 'app/models/group_order_article_quantity.rb' + - 'app/models/invite.rb' + - 'app/models/invoice.rb' + - 'app/models/order_article.rb' + - 'app/models/order_comment.rb' + - 'app/models/stock_change.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: ConvertTry. -Rails/SafeNavigation: +# This cop supports unsafe autocorrection (--autocorrect-all). +Rails/RootPathnameMethods: Exclude: - - "app/models/group_order_article.rb" + - 'lib/tasks/foodsoft_setup.rake' -# Offense count: 63 +# Offense count: 64 # Configuration parameters: ForbiddenMethods, AllowedMethods. # ForbiddenMethods: decrement!, decrement_counter, increment!, increment_counter, insert, insert!, insert_all, insert_all!, toggle!, touch, touch_all, update_all, update_attribute, update_column, update_columns, update_counters, upsert, upsert_all Rails/SkipsModelValidations: @@ -908,11 +751,11 @@ Rails/SkipsModelValidations: # This cop supports unsafe autocorrection (--autocorrect-all). Rails/SquishedSQLHeredocs: Exclude: - - "app/controllers/finance/financial_links_controller.rb" - - "app/models/financial_link.rb" - - "db/migrate/20181201000305_ensure_article_for_article_price.rb" + - 'app/controllers/finance/financial_links_controller.rb' + - 'app/models/financial_link.rb' + - 'db/migrate/20181201000305_ensure_article_for_article_price.rb' -# Offense count: 41 +# Offense count: 42 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: strict, flexible @@ -922,37 +765,34 @@ Rails/TimeZone: # Offense count: 1 Rails/TransactionExitStatement: Exclude: - - "app/models/bank_transaction.rb" + - 'app/models/bank_transaction.rb' -# Offense count: 3 +# Offense count: 8 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/UniqueValidationWithoutIndex: Exclude: - - "app/models/bank_account.rb" - - "app/models/supplier_category.rb" + - 'app/models/bank_account.rb' + - 'app/models/financial_transaction_class.rb' + - 'app/models/financial_transaction_type.rb' + - 'app/models/supplier.rb' + - 'app/models/supplier_category.rb' + - 'app/models/user.rb' # Offense count: 2 # Configuration parameters: Environments. # Environments: development, test, production Rails/UnknownEnv: Exclude: - - "config/initializers/gaffe.rb" - - "config/initializers/secret_token.rb" - -# Offense count: 69 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Include. -# Include: app/models/**/*.rb -Rails/Validation: - Enabled: false + - 'config/initializers/gaffe.rb' + - 'config/initializers/secret_token.rb' # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). Rails/WhereEquals: Exclude: - - "app/controllers/finance/invoices_controller.rb" - - "app/models/financial_transaction.rb" + - 'app/controllers/finance/invoices_controller.rb' + - 'app/models/financial_transaction.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -960,84 +800,54 @@ Rails/WhereEquals: # SupportedStyles: exists, where Rails/WhereExists: Exclude: - - "app/models/concerns/mark_as_deleted_with_name.rb" + - 'app/models/concerns/mark_as_deleted_with_name.rb' # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). Rails/WhereNot: Exclude: - - "db/migrate/20140921104907_remove_stale_memberships.rb" - - "db/migrate/20210205090257_introduce_received_state_in_orders.rb" + - 'db/migrate/20140921104907_remove_stale_memberships.rb' + - 'db/migrate/20210205090257_introduce_received_state_in_orders.rb' -# Offense count: 5 +# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). Security/YAMLLoad: Exclude: - - "app/controllers/finance/bank_accounts_controller.rb" - - "db/migrate/20130718183101_migrate_user_settings.rb" - - "db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb" - - "lib/foodsoft_config.rb" - - "spec/api/v1/swagger_spec.rb" + - 'app/controllers/finance/bank_accounts_controller.rb' + - 'app/lib/foodsoft_config.rb' + - 'db/migrate/20130718183101_migrate_user_settings.rb' + - 'db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb' # Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: prefer_alias, prefer_alias_method -Style/Alias: - Exclude: - - "config/initializers/session_store.rb" - - "plugins/discourse/lib/foodsoft_discourse/redirect_to_login.rb" - - "plugins/printer/lib/foodsoft_printer/order_printer_jobs.rb" - -# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, conditionals Style/AndOr: Exclude: - - "config/initializers/extensions.rb" - - "lib/apple_bar.rb" - - "plugins/documents/app/controllers/documents_controller.rb" - - "spec/support/coverage.rb" + - 'config/initializers/extensions.rb' + - 'plugins/documents/app/controllers/documents_controller.rb' + - 'spec/support/coverage.rb' -# Offense count: 19 +# Offense count: 10 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. +# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object # FunctionalMethods: let, let!, subject, watch # AllowedMethods: lambda, proc, it Style/BlockDelimiters: Exclude: - - "app/controllers/api/v1/user/ordergroup_controller.rb" - - "app/helpers/group_orders_helper.rb" - - "app/helpers/orders_helper.rb" - - "app/models/order.rb" - - "db/migrate/008_create_orders.rb" - - "lib/tasks/resque.rake" - - "spec/api/v1/user/group_order_articles_spec.rb" - - "spec/factories/user.rb" - - "spec/lib/foodsoft_mail_receiver_spec.rb" - - "spec/support/coverage.rb" + - 'app/lib/foodsoft_config.rb' + - 'db/migrate/008_create_orders.rb' + - 'spec/factories/user.rb' + - 'spec/support/coverage.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowOnConstant, AllowOnSelfClass. Style/CaseEquality: Exclude: - - "lib/tasks/foodsoft_setup.rake" - -# Offense count: 7 -# This cop supports unsafe autocorrection (--autocorrect-all). -Style/CaseLikeIf: - Exclude: - - "app/helpers/admin/configs_helper.rb" - - "app/helpers/group_orders_helper.rb" - - "app/models/order.rb" - - "lib/foodsoft_date_util.rb" - - "lib/render_pdf.rb" - - "lib/tasks/foodsoft_setup.rake" - - "plugins/uservoice/lib/foodsoft_uservoice.rb" + - 'lib/tasks/foodsoft_setup.rake' # Offense count: 55 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -1047,95 +857,23 @@ Style/ClassAndModuleChildren: Enabled: false # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: is_a?, kind_of? -Style/ClassCheck: - Exclude: - - "app/helpers/orders_helper.rb" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. -# AllowedMethods: ==, equal?, eql? -Style/ClassEqualityComparison: - Exclude: - - "spec/factories/supplier.rb" - -# Offense count: 3 Style/ClassVars: Exclude: - - "lib/bank_account_connector.rb" - - "lib/foodsoft/expansion_variables.rb" - - "lib/foodsoft_mail_receiver.rb" - -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -Style/ColonMethodCall: - Exclude: - - "app/models/supplier.rb" - - "plugins/discourse/app/controllers/discourse_controller.rb" - - "plugins/messages/app/mail_receivers/messages_mail_receiver.rb" - -# Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, AllowInnerBackticks. -# SupportedStyles: backticks, percent_x, mixed -Style/CommandLiteral: - Exclude: - - "lib/tasks/foodsoft_setup.rake" - -# Offense count: 10 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: Keywords, RequireColon. -# Keywords: TODO, FIXME, OPTIMIZE, HACK, REVIEW, NOTE -Style/CommentAnnotation: - Exclude: - - "app/controllers/admin/configs_controller.rb" - - "app/inputs/delta_input.rb" - - "app/models/order_article.rb" - - "app/models/shared_supplier.rb" - - "config/application.rb" - - "spec/models/article_spec.rb" - - "spec/models/order_spec.rb" - - "spec/support/shared_database.rb" + - 'app/lib/foodsoft_mail_receiver.rb' # Offense count: 12 # This cop supports unsafe autocorrection (--autocorrect-all). Style/CommentedKeyword: Exclude: - - "app/controllers/deliveries_controller.rb" - - "app/controllers/finance/balancing_controller.rb" - - "app/controllers/orders_controller.rb" - - "app/controllers/stock_takings_controller.rb" - - "app/controllers/stockit_controller.rb" - - "config/routes.rb" - - "db/migrate/20090120184410_road_to_version_three.rb" + - 'app/controllers/deliveries_controller.rb' + - 'app/controllers/finance/balancing_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/controllers/stock_takings_controller.rb' + - 'app/controllers/stockit_controller.rb' + - 'config/routes.rb' + - 'db/migrate/20090120184410_road_to_version_three.rb' -# Offense count: 13 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. -# SupportedStyles: assign_to_condition, assign_inside_condition -Style/ConditionalAssignment: - Exclude: - - "app/controllers/application_controller.rb" - - "app/controllers/articles_controller.rb" - - "app/controllers/concerns/locale.rb" - - "app/controllers/finance/bank_transactions_controller.rb" - - "app/controllers/finance/financial_transactions_controller.rb" - - "app/controllers/home_controller.rb" - - "app/controllers/orders_controller.rb" - - "plugins/documents/app/controllers/documents_controller.rb" - - "plugins/messages/app/mail_receivers/messages_mail_receiver.rb" - - "plugins/wiki/app/controllers/pages_controller.rb" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/DefWithParentheses: - Exclude: - - "app/models/user.rb" - -# Offense count: 322 +# Offense count: 337 # Configuration parameters: AllowedConstants. Style/Documentation: Enabled: false @@ -1146,60 +884,20 @@ Style/Documentation: # SupportedStyles: allowed_in_returns, forbidden Style/DoubleNegation: Exclude: - - "app/controllers/tasks_controller.rb" + - 'app/controllers/tasks_controller.rb' -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, AllowComments. -# SupportedStyles: empty, nil, both -Style/EmptyElse: - Exclude: - - "app/helpers/application_helper.rb" - - "app/models/article.rb" - - "app/models/order_article.rb" - - "app/models/user.rb" - - "lib/token_verifier.rb" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/EmptyLiteral: - Exclude: - - "plugins/wiki/app/helpers/pages_helper.rb" - -# Offense count: 14 +# Offense count: 6 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle. # SupportedStyles: compact, expanded Style/EmptyMethod: Exclude: - - "app/controllers/articles_controller.rb" - - "app/controllers/feedback_controller.rb" - - "app/controllers/finance/invoices_controller.rb" - - "app/controllers/home_controller.rb" - - "app/controllers/login_controller.rb" - - "app/mailers/mailer.rb" - - "db/migrate/024_add_deposit_defaults.rb" - - "db/migrate/20090120184410_road_to_version_three.rb" - - "db/migrate/20090907120012_add_missing_indexes.rb" - - "db/migrate/20130702113610_update_group_order_totals.rb" - - "db/migrate/20130718183101_migrate_user_settings.rb" - - "db/migrate/20140318173000_delete_empty_group_order_articles.rb" - - "lib/bank_account_connector.rb" - -# Offense count: 21 -# This cop supports safe autocorrection (--autocorrect). -Style/ExpandPathArguments: - Enabled: false - -# Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). -Style/ExplicitBlockArgument: - Exclude: - - "app/documents/order_fax.rb" - - "app/helpers/admin/configs_helper.rb" - - "app/models/concerns/find_each_with_order.rb" - - "plugins/current_orders/app/documents/multiple_orders_by_articles.rb" - - "plugins/current_orders/app/documents/multiple_orders_by_groups.rb" + - 'db/migrate/024_add_deposit_defaults.rb' + - 'db/migrate/20090120184410_road_to_version_three.rb' + - 'db/migrate/20090907120012_add_missing_indexes.rb' + - 'db/migrate/20130702113610_update_group_order_totals.rb' + - 'db/migrate/20130718183101_migrate_user_settings.rb' + - 'db/migrate/20140318173000_delete_empty_group_order_articles.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -1207,7 +905,7 @@ Style/ExplicitBlockArgument: # SupportedStyles: left_coerce, right_coerce, single_coerce, fdiv Style/FloatDivision: Exclude: - - "app/models/ordergroup.rb" + - 'app/models/ordergroup.rb' # Offense count: 18 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -1215,33 +913,25 @@ Style/FloatDivision: # SupportedStyles: each, for Style/For: Exclude: - - "app/controllers/admin/configs_controller.rb" - - "app/models/delivery.rb" - - "app/models/group_order.rb" - - "app/models/order.rb" - - "app/models/stock_taking.rb" - - "app/models/supplier.rb" - - "db/migrate/005_create_financial_transactions.rb" - - "lib/tasks/foodsoft.rake" - - "plugins/messages/app/mail_receivers/messages_mail_receiver.rb" - - "plugins/wiki/app/views/pages/all.rss.builder" - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: format, sprintf, percent -Style/FormatString: - Exclude: - - "lib/order_txt.rb" + - 'app/controllers/admin/configs_controller.rb' + - 'app/models/delivery.rb' + - 'app/models/group_order.rb' + - 'app/models/order.rb' + - 'app/models/stock_taking.rb' + - 'app/models/supplier.rb' + - 'db/migrate/005_create_financial_transactions.rb' + - 'lib/tasks/foodsoft.rake' + - 'plugins/messages/app/mail_receivers/messages_mail_receiver.rb' + - 'plugins/wiki/app/views/pages/all.rss.builder' # Offense count: 6 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns, IgnoredMethods. +# Configuration parameters: MaxUnannotatedPlaceholdersAllowed, AllowedMethods, AllowedPatterns. # SupportedStyles: annotated, template, unannotated Style/FormatStringToken: EnforcedStyle: unannotated -# Offense count: 498 +# Offense count: 511 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: EnforcedStyle. # SupportedStyles: always, always_true, never @@ -1252,48 +942,38 @@ Style/FrozenStringLiteralComment: # This cop supports unsafe autocorrection (--autocorrect-all). Style/GlobalStdStream: Exclude: - - "config/environments/production.rb" - - "lib/tasks/foodsoft.rake" - - "lib/tasks/foodsoft_setup.rake" + - 'config/environments/production.rb' + - 'lib/tasks/foodsoft.rake' + - 'lib/tasks/foodsoft_setup.rake' -# Offense count: 61 +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: - Enabled: false - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: braces, no_braces -Style/HashAsLastArrayItem: Exclude: - - "app/models/order.rb" + - 'db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb' + - 'plugins/wiki/app/controllers/pages_controller.rb' -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowSplatArgument. -Style/HashConversion: +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/HashExcept: Exclude: - - "app/helpers/application_helper.rb" - - "app/models/article.rb" - - "app/models/order.rb" - - "plugins/wiki/app/controllers/pages_controller.rb" - - "spec/api/v1/user/ordergroup_spec.rb" + - 'spec/models/article_spec.rb' # Offense count: 8 # Configuration parameters: MinBranchesCount. Style/HashLikeCase: Exclude: - - "app/controllers/articles_controller.rb" - - "app/controllers/finance/bank_transactions_controller.rb" - - "app/controllers/finance/financial_transactions_controller.rb" - - "app/controllers/home_controller.rb" - - "app/controllers/orders_controller.rb" - - "app/helpers/finance/balancing_helper.rb" - - "plugins/documents/app/controllers/documents_controller.rb" - - "plugins/wiki/app/controllers/pages_controller.rb" + - 'app/controllers/articles_controller.rb' + - 'app/controllers/finance/bank_transactions_controller.rb' + - 'app/controllers/finance/financial_transactions_controller.rb' + - 'app/controllers/home_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/helpers/finance/balancing_helper.rb' + - 'plugins/documents/app/controllers/documents_controller.rb' + - 'plugins/wiki/app/controllers/pages_controller.rb' -# Offense count: 3904 +# Offense count: 375 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys @@ -1301,122 +981,64 @@ Style/HashLikeCase: Style/HashSyntax: Enabled: false -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowIfModifier. -Style/IfInsideElse: - Exclude: - - "app/models/article.rb" - - "app/models/task.rb" - - "lib/apple_bar.rb" - - "plugins/wiki/app/controllers/pages_controller.rb" - -# Offense count: 61 +# Offense count: 1 # This cop supports safe autocorrection (--autocorrect). Style/IfUnlessModifier: - Enabled: false + Exclude: + - 'db/migrate/20090120184410_road_to_version_three.rb' -# Offense count: 2 +# Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods. # AllowedMethods: nonzero? Style/IfWithBooleanLiteralBranches: Exclude: - - "app/models/order_article.rb" - - "app/models/task.rb" - -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Style/InfiniteLoop: - Exclude: - - "lib/order_pdf.rb" + - 'app/models/order_article.rb' # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: InverseMethods, InverseBlocks. Style/InverseMethods: Exclude: - - "app/helpers/application_helper.rb" - - "app/helpers/deliveries_helper.rb" - - "spec/support/coverage.rb" - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: line_count_dependent, lambda, literal -Style/Lambda: - Exclude: - - "app/models/financial_link.rb" - - "lib/foodsoft_mail_receiver.rb" - - "plugins/messages/app/models/message.rb" + - 'app/helpers/application_helper.rb' + - 'app/helpers/deliveries_helper.rb' + - 'spec/support/coverage.rb' # Offense count: 5 # This cop supports unsafe autocorrection (--autocorrect-all). Style/LineEndConcatenation: Exclude: - - "db/migrate/20130702113610_update_group_order_totals.rb" - - "plugins/current_orders/app/documents/multiple_orders_by_articles.rb" + - 'db/migrate/20130702113610_update_group_order_totals.rb' + - 'plugins/current_orders/app/documents/multiple_orders_by_articles.rb' # Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods. -Style/MethodCallWithoutArgsParentheses: +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/MapToHash: Exclude: - - "plugins/discourse/app/controllers/discourse_login_controller.rb" - -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: require_parentheses, require_no_parentheses, require_no_parentheses_except_multiline -Style/MethodDefParentheses: - Exclude: - - "app/controllers/concerns/send_order_pdf.rb" - - "app/helpers/application_helper.rb" - - "app/helpers/finance/invoices_helper.rb" - - "plugins/discourse/app/controllers/discourse_controller.rb" + - 'app/models/article.rb' # Offense count: 1 Style/MixinUsage: Exclude: - - "lib/tasks/foodsoft_setup.rake" - -# Offense count: 3 -Style/MultilineBlockChain: - Exclude: - - "app/helpers/group_orders_helper.rb" - - "app/models/order.rb" - - "config/initializers/rails6_backports.rb" + - 'lib/tasks/foodsoft_setup.rake' # Offense count: 2 +Style/MultilineBlockChain: + Exclude: + - 'app/helpers/group_orders_helper.rb' + - 'app/models/order.rb' + +# Offense count: 7 # This cop supports safe autocorrection (--autocorrect). Style/MultilineIfModifier: Exclude: - - "app/models/user.rb" - - "plugins/current_orders/app/controllers/current_orders/ordergroups_controller.rb" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/MultilineIfThen: - Exclude: - - "app/controllers/finance/financial_links_controller.rb" - -# Offense count: 12 -# This cop supports safe autocorrection (--autocorrect). -Style/MultilineWhenThen: - Exclude: - - "app/controllers/finance/balancing_controller.rb" - - "app/helpers/application_helper.rb" - - "app/helpers/finance/balancing_helper.rb" - - "app/models/order.rb" - -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowMethodComparison. -Style/MultipleComparison: - Exclude: - - "app/models/order.rb" - - "app/models/order_article.rb" - - "spec/models/article_spec.rb" + - 'app/controllers/admin/ordergroups_controller.rb' + - 'app/controllers/articles_controller.rb' + - 'app/controllers/orders_controller.rb' + - 'app/documents/order_fax.rb' + - 'app/lib/foodsoft_config.rb' + - 'app/models/ordergroup.rb' + - 'config/initializers/currency_display.rb' # Offense count: 24 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -1425,75 +1047,23 @@ Style/MultipleComparison: Style/MutableConstant: Enabled: false -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: both, prefix, postfix -Style/NegatedIf: - Exclude: - - "app/controllers/orders_controller.rb" - - "app/helpers/articles_helper.rb" - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -Style/NegatedIfElseCondition: - Exclude: - - "app/controllers/articles_controller.rb" - - "app/controllers/concerns/auth.rb" - - "app/models/article.rb" - -# Offense count: 8 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowedMethods. -# AllowedMethods: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with -Style/NestedParenthesizedCalls: - Exclude: - - "app/models/user.rb" - - "spec/models/order_article_spec.rb" - -# Offense count: 7 +# Offense count: 1 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, MinBodyLength. # SupportedStyles: skip_modifier_ifs, always Style/Next: Exclude: - - "app/controllers/finance/financial_transactions_controller.rb" - - "app/controllers/orders_controller.rb" - - "app/helpers/orders_helper.rb" - - "db/migrate/20130622095040_move_weekly_tasks.rb" - - "lib/tasks/foodsoft.rake" + - 'db/migrate/20130622095040_move_weekly_tasks.rb' # Offense count: 2 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: predicate, comparison -Style/NilComparison: - Exclude: - - "app/controllers/application_controller.rb" - - "plugins/wiki/app/helpers/pages_helper.rb" - -# Offense count: 10 -# This cop supports safe autocorrection (--autocorrect). -Style/Not: - Exclude: - - "app/controllers/concerns/auth.rb" - - "app/controllers/orders_controller.rb" - - "app/helpers/deliveries_helper.rb" - - "app/models/group_order_article.rb" - - "app/models/order_article.rb" - - "app/models/supplier.rb" - - "app/models/task.rb" - - "spec/support/coverage.rb" - -# Offense count: 6 -# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: Strict, AllowedNumbers, AllowedPatterns. Style/NumericLiterals: - MinDigits: 7 + MinDigits: 6 -# Offense count: 61 +# Offense count: 60 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns, IgnoredMethods. +# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. # SupportedStyles: predicate, comparison Style/NumericPredicate: Enabled: false @@ -1503,51 +1073,10 @@ Style/NumericPredicate: # AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: Exclude: - - "app/helpers/application_helper.rb" - - "app/helpers/orders_helper.rb" - - "app/models/order_article.rb" - - "lib/tasks/foodsoft_setup.rake" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/OrAssignment: - Exclude: - - "app/controllers/articles_controller.rb" - -# Offense count: 8 -# This cop supports safe autocorrection (--autocorrect). -Style/ParallelAssignment: - Exclude: - - "app/models/article.rb" - - "app/models/group_order_article.rb" - - "app/models/supplier.rb" - - "app/models/user.rb" - - "spec/models/group_order_article_spec.rb" - - "spec/support/session_helper.rb" - -# Offense count: 12 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowSafeAssignment, AllowInMultilineConditions. -Style/ParenthesesAroundCondition: - Exclude: - - "app/controllers/login_controller.rb" - - "app/helpers/application_helper.rb" - - "app/helpers/group_orders_helper.rb" - - "app/models/group_order_article.rb" - - "plugins/wiki/app/controllers/pages_controller.rb" - -# Offense count: 41 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: PreferredDelimiters. -Style/PercentLiteralDelimiters: - Enabled: false - -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -Style/PerlBackrefs: - Exclude: - - "lib/foodsoft/expansion_variables.rb" - - "plugins/wiki/app/helpers/pages_helper.rb" + - 'app/helpers/application_helper.rb' + - 'app/helpers/orders_helper.rb' + - 'app/models/order_article.rb' + - 'lib/tasks/foodsoft_setup.rake' # Offense count: 2 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -1555,207 +1084,77 @@ Style/PerlBackrefs: # SupportedStyles: short, verbose Style/PreferredHashMethods: Exclude: - - "app/helpers/admin/configs_helper.rb" - - "app/helpers/articles_helper.rb" + - 'app/helpers/admin/configs_helper.rb' + - 'app/helpers/articles_helper.rb' -# Offense count: 14 -# This cop supports safe autocorrection (--autocorrect). -Style/Proc: - Exclude: - - "app/helpers/deliveries_helper.rb" - - "app/models/user.rb" - - "config/navigation.rb" - - "plugins/current_orders/lib/foodsoft_current_orders/engine.rb" - - "plugins/links/lib/foodsoft_links/engine.rb" - -# Offense count: 6 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, AllowedCompactTypes. -# SupportedStyles: compact, exploded -Style/RaiseArgs: - Exclude: - - "app/controllers/api/v1/base_controller.rb" - - "app/controllers/concerns/auth_api.rb" - - "app/controllers/concerns/foodcoop_scope.rb" - -# Offense count: 5 +# Offense count: 4 # This cop supports safe autocorrection (--autocorrect). Style/RandomWithOffset: Exclude: - - "db/migrate/007_create_article_prices.rb" - - "db/migrate/008_create_orders.rb" - - "db/seeds/seed_helper.rb" + - 'db/migrate/007_create_article_prices.rb' + - 'db/migrate/008_create_orders.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Methods. Style/RedundantArgument: Exclude: - - "app/controllers/articles_controller.rb" - -# Offense count: 8 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantBegin: - Exclude: - - "app/controllers/articles_controller.rb" - - "app/models/order.rb" - - "lib/foodsoft_mail_receiver.rb" - - "lib/tasks/multicoops.rake" - - "spec/lib/foodsoft_mail_receiver_spec.rb" - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantConditional: - Exclude: - - "app/models/task.rb" + - 'app/controllers/articles_controller.rb' # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: SafeForConstants. Style/RedundantFetchBlock: Exclude: - - "config/puma.rb" + - 'config/puma.rb' -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantFileExtensionInRequire: - Exclude: - - "db/seeds/small.en.seeds.rb" - - "db/seeds/small.nl.seeds.rb" - -# Offense count: 5 +# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). Style/RedundantInterpolation: Exclude: - - "db/migrate/20130718183101_migrate_user_settings.rb" - - "lib/order_pdf.rb" - - "spec/i18n_spec.rb" - - "spec/models/user_spec.rb" + - 'db/migrate/20130718183101_migrate_user_settings.rb' + - 'spec/i18n_spec.rb' + - 'spec/models/user_spec.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). -Style/RedundantRegexpCharacterClass: +Style/RedundantParentheses: Exclude: - - "plugins/wiki/app/helpers/pages_helper.rb" - -# Offense count: 7 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantRegexpEscape: - Exclude: - - "lib/bank_transaction_reference.rb" - - "lib/foodsoft_mail_receiver.rb" - - "plugins/documents/app/controllers/documents_controller.rb" - - "plugins/wiki/app/models/page.rb" - -# Offense count: 15 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowMultipleReturnValues. -Style/RedundantReturn: - Exclude: - - "app/controllers/concerns/auth_api.rb" - - "app/helpers/application_helper.rb" - - "app/helpers/deliveries_helper.rb" - - "app/helpers/group_orders_helper.rb" - - "app/helpers/orders_helper.rb" - - "app/models/article.rb" - - "app/models/bank_transaction.rb" - - "app/models/periodic_task_group.rb" - - "app/models/supplier.rb" - - "lib/bank_transaction_reference.rb" - -# Offense count: 83 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantSelf: - Enabled: false + - 'db/migrate/021_remove_table_article_prices.rb' # Offense count: 1 # This cop supports unsafe autocorrection (--autocorrect-all). Style/RedundantSort: Exclude: - - "app/models/article_category.rb" + - 'app/models/article_category.rb' -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, AllowInnerSlashes. -# SupportedStyles: slashes, percent_r, mixed -Style/RegexpLiteral: - Exclude: - - "plugins/wiki/app/models/page.rb" - - "spec/support/coverage.rb" - -# Offense count: 16 -# This cop supports safe autocorrection (--autocorrect). -Style/RescueModifier: - Exclude: - - "app/controllers/invites_controller.rb" - - "app/models/article.rb" - - "app/models/order.rb" - - "app/models/ordergroup.rb" - - "config/application.rb" - - "lib/apple_bar.rb" - - "lib/date_time_attribute_validate.rb" - - "lib/foodsoft_date_util.rb" - - "plugins/messages/app/models/message.rb" - -# Offense count: 51 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: implicit, explicit -Style/RescueStandardError: - Enabled: false - -# Offense count: 9 +# Offense count: 8 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength. # AllowedMethods: present?, blank?, presence, try, try! Style/SafeNavigation: Exclude: - - "app/controllers/concerns/auth_api.rb" - - "app/controllers/group_order_articles_controller.rb" - - "app/models/article_category.rb" - - "app/models/financial_transaction.rb" - - "app/models/ordergroup.rb" - - "app/models/user.rb" - - "plugins/printer/app/controllers/printer_controller.rb" - - "spec/factories/order.rb" + - 'app/controllers/concerns/auth_api.rb' + - 'app/controllers/group_order_articles_controller.rb' + - 'app/models/article_category.rb' + - 'app/models/financial_transaction.rb' + - 'app/models/user.rb' + - 'plugins/printer/app/controllers/printer_controller.rb' + - 'spec/factories/order.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/SelfAssignment: - Exclude: - - "app/helpers/application_helper.rb" - -# Offense count: 16 +# Offense count: 3 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: AllowAsExpressionSeparator. Style/Semicolon: Exclude: - - "app/controllers/finance/bank_transactions_controller.rb" - - "app/controllers/finance/financial_transactions_controller.rb" - - "app/controllers/finance/invoices_controller.rb" - - "app/controllers/orders_controller.rb" - - "app/helpers/group_orders_helper.rb" - - "db/migrate/20090120184410_road_to_version_three.rb" - - "spec/api/v1/swagger_spec.rb" - - "spec/api/v1/user/group_order_articles_spec.rb" - - "spec/api/v1/user/ordergroup_spec.rb" - - "spec/models/order_article_spec.rb" + - 'db/migrate/20090120184410_road_to_version_three.rb' -# Offense count: 5 +# Offense count: 4 # This cop supports unsafe autocorrection (--autocorrect-all). Style/SlicingWithRange: Exclude: - - "app/helpers/admin/configs_helper.rb" - - "config/initializers/session_store.rb" - - "lib/order_pdf.rb" - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowModifier. -Style/SoleNestedConditional: - Exclude: - - "app/controllers/articles_controller.rb" - - "app/controllers/concerns/auth.rb" + - 'app/helpers/admin/configs_helper.rb' + - 'config/initializers/session_store.rb' # Offense count: 9 # This cop supports unsafe autocorrection (--autocorrect-all). @@ -1764,125 +1163,65 @@ Style/SoleNestedConditional: Style/SpecialGlobalVars: EnforcedStyle: use_perl_names -# Offense count: 33 +# Offense count: 34 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: Mode. Style/StringConcatenation: Enabled: false -# Offense count: 1855 +# Offense count: 140 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. # SupportedStyles: single_quotes, double_quotes Style/StringLiterals: Enabled: false -# Offense count: 80 +# Offense count: 19 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: MinSize. +# Configuration parameters: . # SupportedStyles: percent, brackets Style/SymbolArray: - EnforcedStyle: brackets + EnforcedStyle: percent + MinSize: 5 -# Offense count: 19 +# Offense count: 20 # This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, IgnoredMethods, AllowComments. -# AllowedMethods: respond_to, define_method +# Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, AllowComments. +# AllowedMethods: define_method, mail, respond_to Style/SymbolProc: Exclude: - - "app/controllers/pickups_controller.rb" - - "app/helpers/orders_helper.rb" - - "app/models/delivery.rb" - - "app/models/financial_transaction_class.rb" - - "app/models/financial_transaction_type.rb" - - "app/models/group_order_article.rb" - - "app/models/order.rb" - - "app/models/order_article.rb" - - "app/models/stock_article.rb" - - "app/models/user.rb" - - "db/migrate/20090731132547_add_stats_to_groups.rb" - - "spec/factories/order.rb" - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, AllowSafeAssignment. -# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex -Style/TernaryParentheses: - Exclude: - - "app/models/order_article.rb" - -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInArrayLiteral: - Exclude: - - "lib/articles_csv.rb" - - "lib/invoices_csv.rb" - - "lib/ordergroups_csv.rb" - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInHashLiteral: - Exclude: - - "app/controllers/finance/financial_transactions_controller.rb" - - "config/initializers/exception_notification.rb" - -# Offense count: 8 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: ExactNameMatch, AllowPredicates, AllowDSLWriters, IgnoreClassMethods, AllowedMethods. -# AllowedMethods: to_ary, to_a, to_c, to_enum, to_h, to_hash, to_i, to_int, to_io, to_open, to_path, to_proc, to_r, to_regexp, to_str, to_s, to_sym -Style/TrivialAccessors: - Exclude: - - "app/models/order.rb" - - "lib/bank_account_connector.rb" - - "plugins/messages/app/models/message.rb" - -# Offense count: 5 -# This cop supports safe autocorrection (--autocorrect). -Style/UnlessElse: - Exclude: - - "app/controllers/home_controller.rb" - - "app/controllers/orders_controller.rb" - - "app/helpers/group_order_articles_helper.rb" - - "plugins/current_orders/app/controllers/current_orders/articles_controller.rb" - - "plugins/wiki/app/helpers/pages_helper.rb" + - 'app/controllers/pickups_controller.rb' + - 'app/helpers/orders_helper.rb' + - 'app/models/delivery.rb' + - 'app/models/financial_transaction_class.rb' + - 'app/models/financial_transaction_type.rb' + - 'app/models/group_order_article.rb' + - 'app/models/order.rb' + - 'app/models/order_article.rb' + - 'app/models/stock_article.rb' + - 'app/models/user.rb' + - 'db/migrate/20090731132547_add_stats_to_groups.rb' + - 'spec/factories/order.rb' # Offense count: 1 # This cop supports safe autocorrection (--autocorrect). -Style/WhileUntilModifier: - Exclude: - - "app/models/periodic_task_group.rb" - -# Offense count: 11 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, MinSize, WordRegex. +# Configuration parameters: WordRegex. # SupportedStyles: percent, brackets Style/WordArray: - Exclude: - - "app/documents/order_matrix.rb" - - "app/helpers/application_helper.rb" - - "app/models/supplier.rb" - - "db/migrate/006_create_articles.rb" - - "lib/tasks/foodsoft_setup.rake" - - "plugins/current_orders/app/controllers/current_orders/group_orders_controller.rb" - - "plugins/wiki/app/controllers/pages_controller.rb" - - "plugins/wiki/app/helpers/pages_helper.rb" - - "spec/support/faker.rb" + EnforcedStyle: percent + MinSize: 4 # Offense count: 3 # This cop supports unsafe autocorrection (--autocorrect-all). Style/ZeroLengthPredicate: Exclude: - - "app/models/group_order_article.rb" - - "plugins/current_orders/app/documents/multiple_orders_by_articles.rb" - - "plugins/current_orders/app/documents/multiple_orders_by_groups.rb" + - 'app/models/group_order_article.rb' + - 'plugins/current_orders/app/documents/multiple_orders_by_articles.rb' + - 'plugins/current_orders/app/documents/multiple_orders_by_groups.rb' -# Offense count: 446 +# Offense count: 282 # This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. +# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns. # URISchemes: http, https Layout/LineLength: - Max: 420 + Max: 320 diff --git a/.ruby-version b/.ruby-version index 37c2961c..6a81b4c8 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.2 +2.7.8 diff --git a/CHANGELOG.md b/CHANGELOG.md index f88a1d03..8474e7fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +# Foodsoft 4.8.0 + +* feat: Show total sums for ordergroup finances [#1017](https://github.com/foodcoops/foodsoft/pull/1017) +* feat: Richtext Messages and Attachments with Actiontext [#918](https://github.com/foodcoops/foodsoft/issues/918) +* feat: Make date configurable via locales [#997](https://github.com/foodcoops/foodsoft/pull/997) +* feat: Turkish language support added [#995](https://github.com/foodcoops/foodsoft/pull/995) +* feat: Disable member list via configuration [#990](https://github.com/foodcoops/foodsoft/pull/990) +* feat: Specify an URL to redirect after logout via settings #989 +* feat: introduce importmaps [#983](https://github.com/foodcoops/foodsoft/pull/983) +* feat: ruby 2.7.2 and rails 7 upgrade [#979](https://github.com/foodcoops/foodsoft/pull/979) +* feat: Add home controller test [#972](https://github.com/foodcoops/foodsoft/pull/972) +* feat: Replace apivore with rswag for api tests [#969](https://github.com/foodcoops/foodsoft/pull/969) +* feat: increase test coverage [#966](https://github.com/foodcoops/foodsoft/pull/966) +* feat: Show order note as tooltip [#965](https://github.com/foodcoops/foodsoft/pull/965) +* feat: Add sd_notify [#961](https://github.com/foodcoops/foodsoft/pull/961) +* feat: Show instance name at login screen [#957](https://github.com/foodcoops/foodsoft/pull/957) +* feat: Enabled systemd socket activation [#942](https://github.com/foodcoops/foodsoft/pull/942) +* feat: Add table_print gem for debugging ActiveRecord queries in the console [#935](https://github.com/foodcoops/foodsoft/pull/935) +* feat: Add admin UI for SupplierCategories (supplier_categories) [#930](https://github.com/foodcoops/foodsoft/pull/930) + +* fix: add null checks for articles convert_units [33034e6](https://github.com/foodcoops/foodsoft/commit/33034e66b88968dedc5289425e1eff847ee67e12) +* fix: downgrade haml to make deface work [#1003](https://github.com/foodcoops/foodsoft/pull/1003) +* fix: dutch translation errors [#954](https://github.com/foodcoops/foodsoft/pull/954) +* fix: Fixe filtering of active ordergroups [#934](https://github.com/foodcoops/foodsoft/pull/934) +* fix: Change password validation to allow longer passwords [#923](https://github.com/foodcoops/foodsoft/pull/923) +* fix: Invoice: change label "delivery" to "stock delivery" [#922](https://github.com/foodcoops/foodsoft/pull/922) +* fix: Allow decimal numbers in transaction collections [#921](https://github.com/foodcoops/foodsoft/pull/921) +* fix: Add validation of more article fields [#917](https://github.com/foodcoops/foodsoft/pull/917/files) +* fix: Add default time_zone [#912](https://github.com/foodcoops/foodsoft/pull/912) +* fix: Rename Piwik to Matomo [#911](https://github.com/foodcoops/foodsoft/pull/911/files) +* fix: Change instructions to rbenv [#910](https://github.com/foodcoops/foodsoft/pull/910/files) + + # Foodsoft 4.7.1 (31 December 2020) diff --git a/Dockerfile b/Dockerfile index ae57d2f9..e8f6a4c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,9 +15,7 @@ ENV PORT=3000 \ WORKDIR /usr/src/app -COPY Gemfile Gemfile.lock ./ -COPY plugins/ ./plugins -COPY config/ ./config +COPY . ./ # install dependencies and generate crontab RUN buildDeps='libmagic-dev' && \ @@ -32,8 +30,6 @@ RUN buildDeps='libmagic-dev' && \ \ bundle exec whenever >crontab -COPY . ./ - # compile assets with temporary mysql server RUN export DATABASE_URL=mysql2://localhost/temp?encoding=utf8 && \ export SECRET_KEY_BASE=thisisnotimportantnow && \ diff --git a/Dockerfile-dev b/Dockerfile-dev index 37dce5f6..f25c2062 100644 --- a/Dockerfile-dev +++ b/Dockerfile-dev @@ -1,4 +1,4 @@ -FROM ruby:2.7 +FROM ruby:2.7.8 # Install dependencies RUN deps='libmagic-dev chromium nodejs' && \ @@ -19,6 +19,7 @@ ENV PORT=3000 \ WORKDIR /app +RUN gem update --system RUN gem install bundler RUN bundle config build.nokogiri "--use-system-libraries" diff --git a/Gemfile b/Gemfile index 30662ddb..a8d33863 100644 --- a/Gemfile +++ b/Gemfile @@ -1,74 +1,77 @@ # A sample Gemfile -source "https://rubygems.org" +source 'https://rubygems.org' -gem "rails", '~> 7.0' -gem 'mail', '~> 2.7.1' # bug with mail 2.8.0 https://github.com/mikel/mail/issues/1489 +gem 'rails', '~> 7.0', '>=7.0.4.1' - -gem 'sassc-rails' gem 'less-rails' +gem 'sassc-rails' # See https://github.com/sstephenson/execjs#readme for more supported runtimes gem 'therubyracer', platforms: :ruby -gem 'jquery-rails' -gem 'select2-rails' -gem 'rails_tokeninput' +gem 'bootsnap', require: false gem 'bootstrap-datepicker-rails' gem 'date_time_attribute' -gem 'rails-assets-listjs', '0.2.0.beta.4' # remember to maintain list.*.js plugins and template engines on update gem 'i18n-js', '~> 3.0.0.rc8' +gem 'jquery-rails' +gem 'rails-assets-listjs', '0.2.0.beta.4' # remember to maintain list.*.js plugins and template engines on update gem 'rails-i18n' -gem 'bootsnap', require: false +gem 'rails_tokeninput' +gem 'select2-rails' -gem 'mysql2' -gem 'prawn' -gem 'prawn-table' -gem 'haml', '~> 5.0' -gem 'haml-rails' -gem 'kaminari' -gem 'simple_form' -gem 'inherited_resources' +gem 'active_model_serializers', '~> 0.10.0' +gem 'acts_as_tree' +gem 'attribute_normalizer' gem 'daemons' gem 'doorkeeper' gem 'doorkeeper-i18n' +gem 'haml', '~> 5.0' +gem 'haml-rails' +gem 'ice_cube' +gem 'inherited_resources' +gem 'kaminari' +gem 'mysql2' +gem 'net-ftp' +gem 'net-http' +gem 'prawn' +gem 'prawn-table' +gem 'puma' gem 'rack-cors', require: 'rack/cors' -gem 'active_model_serializers', '~> 0.10.0' -gem 'twitter-bootstrap-rails', '~> 2.2.8' +gem 'rails-settings-cached', '= 0.4.3' # caching breaks tests until Rails 5 https://github.com/huacnlee/rails-settings-cached/issues/73 +gem 'ransack' +gem 'resque' +gem 'ruby-units' +gem 'simple_form' gem 'simple-navigation', '~> 3.14.0' # 3.x for simple_navigation_bootstrap gem 'simple-navigation-bootstrap' gem 'sprockets', '< 4' -gem 'ransack' -gem 'acts_as_tree' -gem 'rails-settings-cached', '= 0.4.3' # caching breaks tests until Rails 5 https://github.com/huacnlee/rails-settings-cached/issues/73 -gem 'resque' -gem 'puma' -gem 'sd_notify' +gem 'twitter-bootstrap-rails', '~> 2.2.8' gem 'whenever', require: false # For defining cronjobs, see config/schedule.rb -gem 'ruby-units' -gem 'attribute_normalizer' -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', 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-xls' -gem 'spreadsheet' gem 'exception_notification' gem 'gaffe' -gem 'ruby-filemagic' -gem 'mime-types' +gem 'hashie', '~> 3.4.6', require: false # https://github.com/westfieldlabs/apivore/issues/114 +gem "image_processing", "~> 1.12" +gem "importmap-rails", "~> 1.1" gem 'midi-smtp-server' +gem 'mime-types' +gem 'recurring_select', git: 'https://github.com/gregschmit/recurring_select' +gem 'roo' +gem 'roo-xls' gem 'rswag-api' gem 'rswag-ui' +gem 'ruby-filemagic' +gem 'spreadsheet' +gem "terser", "~> 1.1" # 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 'foodsoft_wiki', path: 'plugins/wiki' -gem 'foodsoft_messages', path: 'plugins/messages' -gem 'foodsoft_documents', path: 'plugins/documents' gem 'foodsoft_discourse', path: 'plugins/discourse' +gem 'foodsoft_documents', path: 'plugins/documents' gem 'foodsoft_links', path: 'plugins/links' +gem 'foodsoft_messages', path: 'plugins/messages' gem 'foodsoft_polls', path: 'plugins/polls' +gem 'foodsoft_wiki', path: 'plugins/wiki' +gem 'foodsoft_automatic_invoices', path: 'plugins/automatic_invoices' # plugins not enabled by default # gem 'foodsoft_current_orders', path: 'plugins/current_orders' @@ -76,10 +79,10 @@ gem 'foodsoft_polls', path: 'plugins/polls' # gem 'foodsoft_uservoice', path: 'plugins/uservoice' group :development do - gem 'sqlite3', '~> 1.3.6' - gem 'mailcatcher' - gem 'web-console' gem 'listen' + gem 'mailcatcher' + gem 'sqlite3', '~> 1.3.6' + gem 'web-console' # Better error output gem 'better_errors' @@ -107,26 +110,20 @@ group :development, :test do end group :test do - gem 'rspec-rails' + gem 'apparition' # Capybara javascript driver + gem 'capybara' + gem 'connection_pool' + gem 'database_cleaner' gem 'factory_bot_rails' gem 'faker' - gem 'capybara' - gem 'apparition' # Capybara javascript driver - gem 'database_cleaner' - gem 'connection_pool' + gem 'rspec-rails' # need to include rspec components before i18n-spec or rake fails in test environment + gem 'i18n-spec' gem 'rspec-core' gem 'rspec-rerun' - gem 'i18n-spec' - gem 'rails-controller-testing' # code coverage gem 'simplecov', require: false gem 'simplecov-lcov', require: false # api gem 'rswag-specs' - gem 'hashie', '~> 3.4.6', require: false # https://github.com/westfieldlabs/apivore/issues/114 end - -gem "importmap-rails", "~> 1.1" -gem "image_processing", "~> 1.12" -gem "terser", "~> 1.1" diff --git a/Gemfile.lock b/Gemfile.lock index 6f60ccef..74d736a6 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,11 +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 @@ -24,6 +16,13 @@ GIT acts_as_versioned (0.6.0) activerecord (>= 3.0.9) +PATH + remote: plugins/automatic_invoices + specs: + foodsoft_automatic_invoices (0.0.1) + deface (~> 1.9) + rails + PATH remote: plugins/discourse specs: @@ -78,47 +77,47 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + actioncable (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + actionmailbox (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) 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) + actionmailer (7.0.8) + actionpack (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activesupport (= 7.0.8) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) - rack (~> 2.0, >= 2.2.0) + actionpack (7.0.8) + actionview (= 7.0.8) + activesupport (= 7.0.8) + rack (~> 2.0, >= 2.2.4) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (7.0.4) - actionpack (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + actiontext (7.0.8) + actionpack (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.0.4) - activesupport (= 7.0.4) + actionview (7.0.8) + activesupport (= 7.0.8) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -128,22 +127,22 @@ GEM activemodel (>= 4.1, < 7.1) case_transform (>= 0.2) jsonapi-renderer (>= 0.1.1.beta1, < 0.3) - activejob (7.0.4) - activesupport (= 7.0.4) + activejob (7.0.8) + activesupport (= 7.0.8) globalid (>= 0.3.6) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activestorage (7.0.4) - actionpack (= 7.0.4) - activejob (= 7.0.4) - activerecord (= 7.0.4) - activesupport (= 7.0.4) + activemodel (7.0.8) + activesupport (= 7.0.8) + activerecord (7.0.8) + activemodel (= 7.0.8) + activesupport (= 7.0.8) + activestorage (7.0.8) + actionpack (= 7.0.8) + activejob (= 7.0.8) + activerecord (= 7.0.8) + activesupport (= 7.0.8) marcel (~> 1.0) mini_mime (>= 1.1.0) - activesupport (7.0.4) + activesupport (7.0.8) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -194,7 +193,7 @@ GEM execjs coffee-script-source (1.12.2) commonjs (0.2.7) - concurrent-ruby (1.1.10) + concurrent-ruby (1.2.2) connection_pool (2.3.0) content_for_in_controllers (0.0.2) crass (1.0.6) @@ -218,7 +217,7 @@ GEM diff-lcs (1.5.0) diffy (3.4.2) docile (1.4.0) - doorkeeper (5.6.2) + doorkeeper (5.6.6) railties (>= 5) doorkeeper-i18n (5.2.6) doorkeeper (>= 5.2) @@ -240,7 +239,7 @@ GEM ffi (1.15.5) gaffe (1.2.0) rails (>= 4.0.0) - globalid (1.0.0) + globalid (1.0.1) activesupport (>= 5.0) haml (5.2.2) temple (>= 0.8.0) @@ -255,7 +254,7 @@ GEM activesupport (>= 5.2) hashie (3.4.6) htmlentities (4.3.4) - i18n (1.12.0) + i18n (1.14.1) concurrent-ruby (~> 1.0) i18n-js (3.0.11) i18n (>= 0.6.6, < 2) @@ -306,11 +305,14 @@ GEM listen (3.7.1) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.19.1) + loofah (2.21.3) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.8.1) mini_mime (>= 0.1.1) + net-imap + net-pop + net-smtp mailcatcher (0.2.4) eventmachine haml @@ -330,13 +332,18 @@ GEM mime-types-data (3.2022.0105) mini_magick (4.12.0) mini_mime (1.1.2) - minitest (5.17.0) + minitest (5.18.0) mono_logger (1.1.1) msgpack (1.6.0) multi_json (1.15.0) mustermann (3.0.0) ruby2_keywords (~> 0.0.1) mysql2 (0.5.4) + net-ftp (0.2.0) + net-protocol + time + net-http (0.3.2) + uri net-imap (0.3.4) date net-protocol @@ -346,11 +353,11 @@ GEM timeout net-smtp (0.3.3) net-protocol - nio4r (2.5.8) - nokogiri (1.13.10-x86_64-linux) + nio4r (2.5.9) + nokogiri (1.15.2-x86_64-linux) racc (~> 1.4) - parallel (1.22.1) - parser (3.2.0.0) + parallel (1.23.0) + parser (3.2.2.1) ast (~> 2.4.1) pdf-core (0.9.0) polyglot (0.3.5) @@ -369,41 +376,38 @@ GEM binding_of_caller (~> 1.0) pry (~> 0.13) public_suffix (5.0.1) - puma (6.0.2) + puma (6.3.1) nio4r (~> 2.0) - racc (1.6.2) - rack (2.2.5) + racc (1.7.0) + rack (2.2.7) rack-cors (1.1.1) rack (>= 2.0.0) rack-protection (3.0.5) rack - rack-test (2.0.2) + rack-test (2.1.0) rack (>= 1.3) - rails (7.0.4) - actioncable (= 7.0.4) - actionmailbox (= 7.0.4) - actionmailer (= 7.0.4) - actionpack (= 7.0.4) - actiontext (= 7.0.4) - actionview (= 7.0.4) - activejob (= 7.0.4) - activemodel (= 7.0.4) - activerecord (= 7.0.4) - activestorage (= 7.0.4) - activesupport (= 7.0.4) + rails (7.0.8) + actioncable (= 7.0.8) + actionmailbox (= 7.0.8) + actionmailer (= 7.0.8) + actionpack (= 7.0.8) + actiontext (= 7.0.8) + actionview (= 7.0.8) + activejob (= 7.0.8) + activemodel (= 7.0.8) + activerecord (= 7.0.8) + activestorage (= 7.0.8) + activesupport (= 7.0.8) bundler (>= 1.15.0) - railties (= 7.0.4) + railties (= 7.0.8) rails-assets-listjs (0.2.0.beta.4) 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) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) + rails-html-sanitizer (1.6.0) + loofah (~> 2.21) + nokogiri (~> 1.14) rails-i18n (7.0.6) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) @@ -411,9 +415,9 @@ GEM rails (>= 4.2.0) rails_tokeninput (1.7.0) railties (>= 3.1.0) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + railties (7.0.8) + actionpack (= 7.0.8) + activesupport (= 7.0.8) method_source rake (>= 12.2) thor (~> 1.0) @@ -434,7 +438,7 @@ GEM redis-namespace (1.10.0) redis (>= 4) ref (2.0.0) - regexp_parser (2.6.1) + regexp_parser (2.8.0) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) @@ -476,7 +480,7 @@ GEM rspec-support (3.12.0) rswag-api (2.7.0) railties (>= 3.1, < 7.1) - rswag-specs (2.7.0) + rswag-specs (2.9.0) activesupport (>= 3.1, < 7.1) json-schema (>= 2.2, < 4.0) railties (>= 3.1, < 7.1) @@ -484,18 +488,18 @@ GEM rswag-ui (2.7.0) actionpack (>= 3.1, < 7.1) railties (>= 3.1, < 7.1) - rubocop (1.43.0) + rubocop (1.50.2) json (~> 2.3) parallel (~> 1.10) parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.24.1, < 2.0) + rubocop-ast (>= 1.28.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.24.1) - parser (>= 3.1.1.0) + rubocop-ast (1.28.1) + parser (>= 3.2.1.0) rubocop-rails (2.17.4) activesupport (>= 4.2.0) rack (>= 1.1) @@ -505,7 +509,7 @@ GEM ruby-filemagic (0.7.3) ruby-ole (1.2.12.2) ruby-prof (1.4.5) - ruby-progressbar (1.11.0) + ruby-progressbar (1.13.0) ruby-units (3.0.0) ruby-vips (2.1.4) ffi (~> 1.12) @@ -521,7 +525,6 @@ GEM sprockets (> 3.0) sprockets-rails tilt - sd_notify (0.1.1) select2-rails (4.0.13) simple-navigation (3.14.0) activesupport (>= 2.3.2) @@ -569,8 +572,10 @@ GEM daemons (>= 1.0.9) eventmachine (>= 1.0.0) rack (>= 1.0.0) - thor (1.2.1) + thor (1.2.2) tilt (2.0.11) + time (0.2.2) + date timeout (0.3.1) ttfunk (1.7.0) twitter-bootstrap-rails (2.2.8) @@ -580,13 +585,14 @@ GEM railties (>= 3.1) twitter-text (1.14.7) unf (~> 0.1.0) - tzinfo (2.0.5) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) unf (0.1.4) unf_ext unf_ext (0.0.8.2) unicode-display_width (2.4.2) uniform_notifier (1.16.0) + uri (0.10.0.2) web-console (4.2.0) actionview (>= 6.0.0) activemodel (>= 6.0.0) @@ -605,7 +611,7 @@ GEM twitter-text xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.6) + zeitwerk (2.6.8) PLATFORMS x86_64-linux @@ -631,7 +637,7 @@ DEPENDENCIES exception_notification factory_bot_rails faker - foodsoft_article_import! + foodsoft_automatic_invoices! foodsoft_discourse! foodsoft_documents! foodsoft_links! @@ -652,20 +658,20 @@ DEPENDENCIES kaminari less-rails listen - mail (~> 2.7.1) mailcatcher midi-smtp-server mime-types mysql2 + net-ftp + net-http prawn prawn-table pry-rescue pry-stack_explorer puma rack-cors - rails (~> 7.0) + rails (~> 7.0, >= 7.0.4.1) rails-assets-listjs (= 0.2.0.beta.4) - rails-controller-testing rails-i18n rails-settings-cached (= 0.4.3) rails_tokeninput @@ -687,7 +693,6 @@ DEPENDENCIES ruby-prof ruby-units sassc-rails - sd_notify select2-rails simple-navigation (~> 3.14.0) simple-navigation-bootstrap diff --git a/README.md b/README.md index ccaa4db3..3f253f86 100644 --- a/README.md +++ b/README.md @@ -1,124 +1,71 @@ Foodsoft ========= -[Website](https://foodsoft.local-it.org) -[Prototypefund](https://prototypefund.de/project/weiterentwicklung-von-foodsoft/) +[](https://github.com/foodcoops/foodsoft/actions) +[](https://coveralls.io/r/foodcoops/foodsoft?branch=master) +[](http://inch-ci.org/github/foodcoops/foodsoft) +[](https://codeclimate.com/github/foodcoops/foodsoft) +[](https://hub.docker.com/r/foodcoops/foodsoft) +[](http://rubydoc.info/github/foodcoops/foodsoft) +Web-based software to manage a non-profit food coop (product catalog, ordering, accounting, job scheduling). -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. +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. -Foodsoft wurde ursprünglich entwickelt und betrieben von [foodcoops.net](https://foodcoops.net/) +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). -#### Zielgruppe +Roadmap +------- -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. +If you'd like to see what is currently bring prioritised for development, check [our roadmap](https://github.com/orgs/foodcoops/projects/1). If you'd like to influence the roadmap, please join our [monthly community call](https://forum.foodcoops.net/t/foodsoft-monthly-community-call/573/6). As of March 2023, Foodsoft has limited development capacity but we are trying to build this up once more. For now, we try to prioritise what we work on, in order to focus our efforts. If your proposed changes are waiting for some time without review, please join the community call to discuss. -#### Vorhaben +Developing +---------- -* ✅ Technische Schuld reduzieren -* ✅ Ruby on Rails Upgrade -* ✅ Artikel Import verbessern - (Großhandelschnitstelle) -* ✅ Userexperience Verbessern +> Foodsoft development needs your help! If you want to hack/triage/organise to improve the software, please consider joining our monthly community calls which are announced on [this forum thread](https://forum.foodcoops.net/t/foodsoft-monthly-community-call/573/6). In these calls, we check in with each other, discuss what to prioritise and try to make progress with development and community issues together. -#### Was ist eine Einkaufskooperative? +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 +[](https://gitpod.io/#https://github.com/foodcoops/foodsoft) +Follow these [instructions](doc/SETUP_DEVELOPMENT_GITPOD.md) to complete setup from within the Gitpod workspace. -State of this Fork ------------------- +Deploying +--------- -#### Increase Test Coverage +Setup foodsoft to [run in production](doc/SETUP_PRODUCTION.md), or join an existing +[hosting platform](https://foodcoops.net/foodsoft-hosting/). -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) +License +------- -#### Upgrade +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. -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 +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). -#### 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 - - - ---- - - - ---- - - - ---- - - - ---- - - -csv export - ---- - - +To make it a little easier, configuration files are exempt, so you can just +install and configure Foodsoft without having to publish your changes. These +files are marked as public domain in the file header. +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. diff --git a/Rakefile b/Rakefile index 835180b2..e59b186f 100755 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ #!/usr/bin/env rake # Add your own tasks in files placed in lib/tasks ending in .rake, -require File.expand_path('../config/application', __FILE__) +require File.expand_path('config/application', __dir__) require 'rake' require 'rspec-rerun/tasks' if defined?(RSpec) # http://stackoverflow.com/a/16853615/2866660 diff --git a/VERSION b/VERSION index 3d512a04..5003783a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.7.99 +4.8.99 diff --git a/app/assets/javascripts/application_legacy.js b/app/assets/javascripts/application_legacy.js index ebe63685..cd4a7273 100644 --- a/app/assets/javascripts/application_legacy.js +++ b/app/assets/javascripts/application_legacy.js @@ -8,6 +8,7 @@ //= require bootstrap-datepicker/locales/bootstrap-datepicker.es //= require bootstrap-datepicker/locales/bootstrap-datepicker.nl //= require bootstrap-datepicker/locales/bootstrap-datepicker.fr +//= require bootstrap-datepicker/locales/bootstrap-datepicker.tr //= require list //= require list.unlist //= require list.delay diff --git a/app/assets/javascripts/ordering.js b/app/assets/javascripts/ordering.js index 1097f8a7..a3dd1050 100644 --- a/app/assets/javascripts/ordering.js +++ b/app/assets/javascripts/ordering.js @@ -179,13 +179,17 @@ function updateBalance() { var balance = groupBalance - total; $('#new_balance').html(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) { + bgcolor = '#FF0000'; $('#submit_button').attr('disabled', 'disabled') - $('#balance-alert').css('display', 'block') - } else { $('#submit_button').removeAttr('disabled') - $('#balance-alert').css('display', 'none') + } + // update bgcolor + for (i in itemTotal) { + $('#td_price_' + i).css('background-color', bgcolor); } } diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 3d98e4a5..971308c9 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -230,7 +230,7 @@ table { margin: .5em 0; input:disabled { - background-color: gray; } + background-color: red; } } } } @@ -241,9 +241,6 @@ table { tr.order-article:hover .article-info { display: none; } - tr.order-article:focus .article-info { - display: none; - } } #order-footer { @@ -278,13 +275,10 @@ tr.order-article .article-info { display: none; } -tr.order-article:focus .article-info { +tr.order-article:hover .article-info { display: block; } -tr.order-article:focus { - background-color: #E9E9E9; -} // ********* Articles diff --git a/app/assets/stylesheets/list.missing.css b/app/assets/stylesheets/list.missing.css index 2dc36577..4eea5d78 100644 --- a/app/assets/stylesheets/list.missing.css +++ b/app/assets/stylesheets/list.missing.css @@ -1,23 +1,11 @@ -.missing-many td { - background-color: #ffc590aa; +.list .missing-many td, .list .missing-many:hover td { + background-color: #ebbebe; } -.missing-many:hover td, .missing-many:focus td { - background-color: #ffc590; +.list .missing-few td, .list .missing-few:hover td { + background-color: #ffee75; } -.missing-few td { - background-color: #fcf488aa; -} - -.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; +.list .missing-none td, .list .missing-none:hover td { + background-color: #E4EED6; } diff --git a/app/controllers/admin/bank_accounts_controller.rb b/app/controllers/admin/bank_accounts_controller.rb index e23b03b2..d37f57e8 100644 --- a/app/controllers/admin/bank_accounts_controller.rb +++ b/app/controllers/admin/bank_accounts_controller.rb @@ -3,39 +3,39 @@ class Admin::BankAccountsController < Admin::BaseController def new @bank_account = BankAccount.new(params[:bank_account]) - render :layout => false + render layout: false + end + + def edit + @bank_account = BankAccount.find(params[:id]) + render action: 'new', layout: false end def create @bank_account = BankAccount.new(params[:bank_account]) if @bank_account.valid? && @bank_account.save - redirect_to update_bank_accounts_admin_finances_url, :status => 303 + redirect_to update_bank_accounts_admin_finances_url, status: :see_other else - render :action => 'new', :layout => false + render action: 'new', layout: false end end - def edit - @bank_account = BankAccount.find(params[:id]) - render :action => 'new', :layout => false - end - def update @bank_account = BankAccount.find(params[:id]) if @bank_account.update(params[:bank_account]) - redirect_to update_bank_accounts_admin_finances_url, :status => 303 + redirect_to update_bank_accounts_admin_finances_url, status: :see_other else - render :action => 'new', :layout => false + render action: 'new', layout: false end end def destroy @bank_account = BankAccount.find(params[:id]) @bank_account.destroy - redirect_to update_bank_accounts_admin_finances_url, :status => 303 - rescue => error - flash.now[:alert] = error.message + redirect_to update_bank_accounts_admin_finances_url, status: :see_other + rescue StandardError => e + flash.now[:alert] = e.message render template: 'shared/alert' end end diff --git a/app/controllers/admin/bank_gateways_controller.rb b/app/controllers/admin/bank_gateways_controller.rb index 3965c91b..c7ca5516 100644 --- a/app/controllers/admin/bank_gateways_controller.rb +++ b/app/controllers/admin/bank_gateways_controller.rb @@ -6,6 +6,11 @@ class Admin::BankGatewaysController < Admin::BaseController render layout: false end + def edit + @bank_gateway = BankGateway.find(params[:id]) + render action: 'new', layout: false + end + def create @bank_gateway = BankGateway.new(params[:bank_gateway]) if @bank_gateway.valid? && @bank_gateway.save @@ -15,11 +20,6 @@ class Admin::BankGatewaysController < Admin::BaseController end end - def edit - @bank_gateway = BankGateway.find(params[:id]) - render action: 'new', layout: false - end - def update @bank_gateway = BankGateway.find(params[:id]) diff --git a/app/controllers/admin/configs_controller.rb b/app/controllers/admin/configs_controller.rb index 516113af..500c1b87 100644 --- a/app/controllers/admin/configs_controller.rb +++ b/app/controllers/admin/configs_controller.rb @@ -1,5 +1,5 @@ class Admin::ConfigsController < Admin::BaseController - before_action :get_tabs, only: [:show, :list] + before_action :get_tabs, only: %i[show list] def show @current_tab = @tabs.include?(params[:tab]) ? params[:tab] : @tabs.first @@ -16,7 +16,7 @@ class Admin::ConfigsController < Admin::BaseController def update parse_recurring_selects! params[:config][:order_schedule] ActiveRecord::Base.transaction do - # TODO support nested configuration keys + # TODO: support nested configuration keys params[:config].each do |key, val| FoodsoftConfig[key] = convert_config_value val end @@ -29,7 +29,7 @@ class Admin::ConfigsController < Admin::BaseController # Set configuration tab names as `@tabs` def get_tabs - @tabs = %w(foodcoop payment tasks messages layout language security others) + @tabs = %w[foodcoop payment tasks messages layout language security others] # allow engines to modify this list engines = Rails::Engine.subclasses.map(&:instance).select { |e| e.respond_to?(:configuration) } engines.each { |e| e.configuration(@tabs, self) } @@ -38,16 +38,16 @@ class Admin::ConfigsController < Admin::BaseController # turn recurring rules into something palatable def parse_recurring_selects!(config) - if config - for k in [:pickup, :boxfill, :ends] do - if config[k] - # allow clearing it using dummy value '{}' ('' would break recurring_select) - if config[k][:recurr].present? && config[k][:recurr] != '{}' - config[k][:recurr] = ActiveSupport::JSON.decode(config[k][:recurr]) - config[k][:recurr] = FoodsoftDateUtil.rule_from(config[k][:recurr]).to_ical if config[k][:recurr] - else - config[k] = nil - end + return unless config + + for k in %i[pickup boxfill ends] do + if config[k] + # allow clearing it using dummy value '{}' ('' would break recurring_select) + if config[k][:recurr].present? && config[k][:recurr] != '{}' + config[k][:recurr] = ActiveSupport::JSON.decode(config[k][:recurr]) + config[k][:recurr] = FoodsoftDateUtil.rule_from(config[k][:recurr]).to_ical if config[k][:recurr] + else + config[k] = nil end end end diff --git a/app/controllers/admin/finances_controller.rb b/app/controllers/admin/finances_controller.rb index 5aae587b..75bb7456 100644 --- a/app/controllers/admin/finances_controller.rb +++ b/app/controllers/admin/finances_controller.rb @@ -10,21 +10,21 @@ class Admin::FinancesController < Admin::BaseController def update_bank_accounts @bank_accounts = BankAccount.order('name') - render :layout => false + render layout: false end def update_bank_gateways @bank_gateways = BankGateway.order('name') - render :layout => false + render layout: false end def update_transaction_types @financial_transaction_classes = FinancialTransactionClass.includes(:financial_transaction_types).order('name ASC') - render :layout => false + render layout: false end def update_supplier_categories @supplier_categories = SupplierCategory.order('name') - render :layout => false + render layout: false end end diff --git a/app/controllers/admin/financial_transaction_classes_controller.rb b/app/controllers/admin/financial_transaction_classes_controller.rb index e5d27efd..132e9038 100644 --- a/app/controllers/admin/financial_transaction_classes_controller.rb +++ b/app/controllers/admin/financial_transaction_classes_controller.rb @@ -6,25 +6,25 @@ class Admin::FinancialTransactionClassesController < Admin::BaseController render layout: false end - def create - @financial_transaction_class = FinancialTransactionClass.new(params[:financial_transaction_class]) - if @financial_transaction_class.save - redirect_to update_transaction_types_admin_finances_url, status: 303 - else - render action: 'new', layout: false - end - end - def edit @financial_transaction_class = FinancialTransactionClass.find(params[:id]) render action: 'new', layout: false end + def create + @financial_transaction_class = FinancialTransactionClass.new(params[:financial_transaction_class]) + if @financial_transaction_class.save + redirect_to update_transaction_types_admin_finances_url, status: :see_other + else + render action: 'new', layout: false + end + end + def update @financial_transaction_class = FinancialTransactionClass.find(params[:id]) if @financial_transaction_class.update(params[:financial_transaction_class]) - redirect_to update_transaction_types_admin_finances_url, status: 303 + redirect_to update_transaction_types_admin_finances_url, status: :see_other else render action: 'new', layout: false end @@ -33,9 +33,9 @@ class Admin::FinancialTransactionClassesController < Admin::BaseController def destroy @financial_transaction_class = FinancialTransactionClass.find(params[:id]) @financial_transaction_class.destroy! - redirect_to update_transaction_types_admin_finances_url, status: 303 - rescue => error - flash.now[:alert] = error.message + redirect_to update_transaction_types_admin_finances_url, status: :see_other + rescue StandardError => e + flash.now[:alert] = e.message render template: 'shared/alert' end end diff --git a/app/controllers/admin/financial_transaction_types_controller.rb b/app/controllers/admin/financial_transaction_types_controller.rb index 2710bd6e..322451e4 100644 --- a/app/controllers/admin/financial_transaction_types_controller.rb +++ b/app/controllers/admin/financial_transaction_types_controller.rb @@ -7,25 +7,25 @@ class Admin::FinancialTransactionTypesController < Admin::BaseController render layout: false end - def create - @financial_transaction_type = FinancialTransactionType.new(params[:financial_transaction_type]) - if @financial_transaction_type.save - redirect_to update_transaction_types_admin_finances_url, status: 303 - else - render action: 'new', layout: false - end - end - def edit @financial_transaction_type = FinancialTransactionType.find(params[:id]) render action: 'new', layout: false end + def create + @financial_transaction_type = FinancialTransactionType.new(params[:financial_transaction_type]) + if @financial_transaction_type.save + redirect_to update_transaction_types_admin_finances_url, status: :see_other + else + render action: 'new', layout: false + end + end + def update @financial_transaction_type = FinancialTransactionType.find(params[:id]) if @financial_transaction_type.update(params[:financial_transaction_type]) - redirect_to update_transaction_types_admin_finances_url, status: 303 + redirect_to update_transaction_types_admin_finances_url, status: :see_other else render action: 'new', layout: false end @@ -34,9 +34,9 @@ class Admin::FinancialTransactionTypesController < Admin::BaseController def destroy @financial_transaction_type = FinancialTransactionType.find(params[:id]) @financial_transaction_type.destroy! - redirect_to update_transaction_types_admin_finances_url, status: 303 - rescue => error - flash.now[:alert] = error.message + redirect_to update_transaction_types_admin_finances_url, status: :see_other + rescue StandardError => e + flash.now[:alert] = e.message render template: 'shared/alert' end end diff --git a/app/controllers/admin/mail_delivery_status_controller.rb b/app/controllers/admin/mail_delivery_status_controller.rb index 52a4db92..c0086044 100644 --- a/app/controllers/admin/mail_delivery_status_controller.rb +++ b/app/controllers/admin/mail_delivery_status_controller.rb @@ -3,28 +3,28 @@ class Admin::MailDeliveryStatusController < Admin::BaseController def index @maildeliverystatus = MailDeliveryStatus.order(created_at: :desc) - @maildeliverystatus = @maildeliverystatus.where(email: params[:email]) unless params[:email].blank? + @maildeliverystatus = @maildeliverystatus.where(email: params[:email]) if params[:email].present? @maildeliverystatus = @maildeliverystatus.page(params[:page]).per(@per_page) end def show @maildeliverystatus = MailDeliveryStatus.find(params[:id]) filename = "maildeliverystatus_#{params[:id]}.#{MIME::Types[@maildeliverystatus.attachment_mime].first.preferred_extension}" - send_data(@maildeliverystatus.attachment_data, :filename => filename, :type => @maildeliverystatus.attachment_mime) + send_data(@maildeliverystatus.attachment_data, filename: filename, type: @maildeliverystatus.attachment_mime) end def destroy_all @maildeliverystatus = MailDeliveryStatus.delete_all redirect_to admin_mail_delivery_status_index_path, notice: t('.notice') - rescue => error - redirect_to admin_mail_delivery_status_index_path, alert: I18n.t('errors.general_msg', msg: error.message) + rescue StandardError => e + redirect_to admin_mail_delivery_status_index_path, alert: I18n.t('errors.general_msg', msg: e.message) end def destroy @maildeliverystatus = MailDeliveryStatus.find(params[:id]) @maildeliverystatus.destroy redirect_to admin_mail_delivery_status_index_path, notice: t('.notice') - rescue => error - redirect_to admin_mail_delivery_status_index_path, alert: I18n.t('errors.general_msg', msg: error.message) + rescue StandardError => e + redirect_to admin_mail_delivery_status_index_path, alert: I18n.t('errors.general_msg', msg: e.message) end end diff --git a/app/controllers/admin/ordergroups_controller.rb b/app/controllers/admin/ordergroups_controller.rb index d9dabe1e..213f3a0d 100644 --- a/app/controllers/admin/ordergroups_controller.rb +++ b/app/controllers/admin/ordergroups_controller.rb @@ -2,16 +2,15 @@ class Admin::OrdergroupsController < Admin::BaseController inherit_resources def index - @ordergroups = Ordergroup.undeleted.sort_by_param(params["sort"]) + @ordergroups = Ordergroup.undeleted.sort_by_param(params['sort']) if request.format.csv? - send_data OrdergroupsCsv.new(@ordergroups).to_csv, filename: 'ordergroups.csv', type: 'text/csv' + send_data OrdergroupsCsv.new(@ordergroups).to_csv, filename: 'ordergroups.csv', + type: 'text/csv' end # if somebody uses the search field: - unless params[:query].blank? - @ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:query]}%") - end + @ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:query]}%") if params[:query].present? @ordergroups = @ordergroups.page(params[:page]).per(@per_page) end @@ -19,8 +18,8 @@ class Admin::OrdergroupsController < Admin::BaseController def destroy @ordergroup = Ordergroup.find(params[:id]) @ordergroup.mark_as_deleted - redirect_to admin_ordergroups_url, notice: t('admin.ordergroups.destroy.notice') - rescue => error - redirect_to admin_ordergroups_url, alert: t('admin.ordergroups.destroy.error') + redirect_to admin_ordergroups_url, notice: t('.notice') + rescue StandardError => e + redirect_to admin_ordergroups_url, alert: t('.error') end end diff --git a/app/controllers/admin/supplier_categories_controller.rb b/app/controllers/admin/supplier_categories_controller.rb index f5768a21..f119dfb6 100644 --- a/app/controllers/admin/supplier_categories_controller.rb +++ b/app/controllers/admin/supplier_categories_controller.rb @@ -6,6 +6,11 @@ class Admin::SupplierCategoriesController < Admin::BaseController render layout: false end + def edit + @supplier_category = SupplierCategory.find(params[:id]) + render action: 'new', layout: false + end + def create @supplier_category = SupplierCategory.new(params[:supplier_category]) if @supplier_category.valid? && @supplier_category.save @@ -15,11 +20,6 @@ class Admin::SupplierCategoriesController < Admin::BaseController end end - def edit - @supplier_category = SupplierCategory.find(params[:id]) - render action: 'new', layout: false - end - def update @supplier_category = SupplierCategory.find(params[:id]) diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 18bbbc1d..7d7e9295 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -3,16 +3,14 @@ class Admin::UsersController < Admin::BaseController def index @users = params[:show_deleted] ? User.deleted : User.undeleted - @users = @users.sort_by_param(params["sort"]) + @users = @users.sort_by_param(params['sort']) @users = @users.includes(:mail_delivery_status) - if request.format.csv? - send_data UsersCsv.new(@users).to_csv, filename: 'users.csv', type: 'text/csv' - end + send_data UsersCsv.new(@users).to_csv, filename: 'users.csv', type: 'text/csv' if request.format.csv? # if somebody uses the search field: - @users = @users.natural_search(params[:user_name]) unless params[:user_name].blank? + @users = @users.natural_search(params[:user_name]) if params[:user_name].present? @users = @users.page(params[:page]).per(@per_page) end @@ -20,17 +18,17 @@ class Admin::UsersController < Admin::BaseController def destroy @user = User.find(params[:id]) @user.mark_as_deleted - redirect_to admin_users_url, notice: t('admin.users.destroy.notice') - rescue => error - redirect_to admin_users_url, alert: t('admin.users.destroy.error', error: error.message) + redirect_to admin_users_url, notice: t('.notice') + rescue StandardError => e + redirect_to admin_users_url, alert: t('.error', error: e.message) end def restore @user = User.find(params[:id]) @user.restore - redirect_to admin_users_url, notice: t('admin.users.restore.notice') - rescue => error - redirect_to admin_users_url, alert: t('admin.users.restore.error', error: error.message) + redirect_to admin_users_url, notice: t('.notice') + rescue StandardError => e + redirect_to admin_users_url, alert: t('.error', error: e.message) end def sudo diff --git a/app/controllers/admin/workgroups_controller.rb b/app/controllers/admin/workgroups_controller.rb index 184000bd..f5a9c2a3 100644 --- a/app/controllers/admin/workgroups_controller.rb +++ b/app/controllers/admin/workgroups_controller.rb @@ -4,7 +4,7 @@ class Admin::WorkgroupsController < Admin::BaseController def index @workgroups = Workgroup.order('name ASC') # if somebody uses the search field: - @workgroups = @workgroups.where('name LIKE ?', "%#{params[:query]}%") unless params[:query].blank? + @workgroups = @workgroups.where('name LIKE ?', "%#{params[:query]}%") if params[:query].present? @workgroups = @workgroups.page(params[:page]).per(@per_page) end @@ -12,8 +12,8 @@ class Admin::WorkgroupsController < Admin::BaseController def destroy @workgroup = Workgroup.find(params[:id]) @workgroup.destroy - redirect_to admin_workgroups_url, notice: t('admin.workgroups.destroy.notice') - rescue => error - redirect_to admin_workgroups_url, alert: t('admin.workgroups.destroy.error', error: error.message) + redirect_to admin_workgroups_url, notice: t('.notice') + rescue StandardError => e + redirect_to admin_workgroups_url, alert: t('.error', error: e.message) end end diff --git a/app/controllers/api/v1/base_controller.rb b/app/controllers/api/v1/base_controller.rb index 13e903f1..8bed20ec 100644 --- a/app/controllers/api/v1/base_controller.rb +++ b/app/controllers/api/v1/base_controller.rb @@ -20,29 +20,30 @@ class Api::V1::BaseController < ApplicationController def require_ordergroup authenticate - unless current_ordergroup.present? - raise Api::Errors::PermissionRequired.new('Forbidden, must be in an ordergroup') - end + return if current_ordergroup.present? + + raise Api::Errors::PermissionRequired, 'Forbidden, must be in an ordergroup' end def require_minimum_balance minimum_balance = FoodsoftConfig[:minimum_balance] or return - if current_ordergroup.account_balance < minimum_balance - raise Api::Errors::PermissionRequired.new(t('application.controller.error_minimum_balance', min: minimum_balance)) - end + return unless current_ordergroup.account_balance < minimum_balance + + raise Api::Errors::PermissionRequired, t('application.controller.error_minimum_balance', min: minimum_balance) end def require_enough_apples - if current_ordergroup.not_enough_apples? - s = t('group_orders.messages.not_enough_apples', apples: current_ordergroup.apples, stop_ordering_under: FoodsoftConfig[:stop_ordering_under]) - raise Api::Errors::PermissionRequired.new(s) - end + return unless current_ordergroup.not_enough_apples? + + s = t('group_orders.messages.not_enough_apples', apples: current_ordergroup.apples, + stop_ordering_under: FoodsoftConfig[:stop_ordering_under]) + raise Api::Errors::PermissionRequired, s end def require_config_enabled(config) - unless FoodsoftConfig[config] - raise Api::Errors::PermissionRequired.new(t('application.controller.error_not_enabled', config: config)) - end + return if FoodsoftConfig[config] + + raise Api::Errors::PermissionRequired, t('application.controller.error_not_enabled', config: config) end def skip_session @@ -52,12 +53,12 @@ class Api::V1::BaseController < ApplicationController def not_found_handler(e) # remove where-clauses from error message (not suitable for end-users) msg = e.message.try { |m| m.sub(/\s*\[.*?\]\s*$/, '') } || 'Not found' - render status: 404, json: { error: 'not_found', error_description: msg } + render status: :not_found, json: { error: 'not_found', error_description: msg } end def not_acceptable_handler(e) msg = e.message || 'Data not acceptable' - render status: 422, json: { error: 'not_acceptable', error_description: msg } + render status: :unprocessable_entity, json: { error: 'not_acceptable', error_description: msg } end def doorkeeper_unauthorized_render_options(error:) @@ -70,11 +71,11 @@ class Api::V1::BaseController < ApplicationController def permission_required_handler(e) msg = e.message || 'Forbidden, user has no access' - render status: 403, json: { error: 'forbidden', error_description: msg } + render status: :forbidden, json: { error: 'forbidden', error_description: msg } end # @todo something with ApplicationHelper#show_user - def show_user(user = current_user, **options) + def show_user(user = current_user, **_options) user.display end end diff --git a/app/controllers/api/v1/user/financial_transactions_controller.rb b/app/controllers/api/v1/user/financial_transactions_controller.rb index 96b32e28..3de38de9 100644 --- a/app/controllers/api/v1/user/financial_transactions_controller.rb +++ b/app/controllers/api/v1/user/financial_transactions_controller.rb @@ -16,7 +16,8 @@ class Api::V1::User::FinancialTransactionsController < Api::V1::BaseController def create transaction_type = FinancialTransactionType.find(create_params[:financial_transaction_type_id]) - ft = current_ordergroup.add_financial_transaction!(create_params[:amount], create_params[:note], current_user, transaction_type) + ft = current_ordergroup.add_financial_transaction!(create_params[:amount], create_params[:note], current_user, + transaction_type) render json: ft end diff --git a/app/controllers/api/v1/user/group_order_articles_controller.rb b/app/controllers/api/v1/user/group_order_articles_controller.rb index ce258898..4b65a61d 100644 --- a/app/controllers/api/v1/user/group_order_articles_controller.rb +++ b/app/controllers/api/v1/user/group_order_articles_controller.rb @@ -4,8 +4,8 @@ class Api::V1::User::GroupOrderArticlesController < Api::V1::BaseController before_action -> { doorkeeper_authorize! 'group_orders:user' } before_action :require_ordergroup - before_action :require_minimum_balance, only: [:create, :update] # destroy is ok - before_action :require_enough_apples, only: [:create, :update] # destroy is ok + before_action :require_minimum_balance, only: %i[create update] # destroy is ok + before_action :require_enough_apples, only: %i[create update] # destroy is ok # @todo allow decreasing amounts when minimum balance isn't met def index @@ -35,7 +35,8 @@ class Api::V1::User::GroupOrderArticlesController < Api::V1::BaseController goa = nil GroupOrderArticle.transaction do goa = scope_for_update.includes(:group_order_article_quantities).find(params.require(:id)) - goa.update_quantities((update_params[:quantity] || goa.quantity).to_i, (update_params[:tolerance] || goa.tolerance).to_i) + goa.update_quantities((update_params[:quantity] || goa.quantity).to_i, + (update_params[:tolerance] || goa.tolerance).to_i) goa.order_article.update_results! goa.group_order.update_price! goa.group_order.update!(updated_by: current_user) diff --git a/app/controllers/api/v1/user/ordergroup_controller.rb b/app/controllers/api/v1/user/ordergroup_controller.rb index 08c12b4c..23889fe8 100644 --- a/app/controllers/api/v1/user/ordergroup_controller.rb +++ b/app/controllers/api/v1/user/ordergroup_controller.rb @@ -8,13 +8,13 @@ class Api::V1::User::OrdergroupController < Api::V1::BaseController financial_overview: { account_balance: ordergroup.account_balance.to_f, available_funds: ordergroup.get_available_funds.to_f, - financial_transaction_class_sums: FinancialTransactionClass.sorted.map { |c| + financial_transaction_class_sums: FinancialTransactionClass.sorted.map do |c| { id: c.id, name: c.display, amount: ordergroup["sum_of_class_#{c.id}"].to_f } - } + end } } end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index eb90f9b4..3537f8c4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -19,10 +19,10 @@ class ApplicationController < ActionController::Base private def set_user_last_activity - if current_user && (session[:last_activity] == nil || session[:last_activity] < 1.minutes.ago) - current_user.update_attribute(:last_activity, Time.now) - session[:last_activity] = Time.now - end + return unless current_user && (session[:last_activity].nil? || session[:last_activity] < 1.minute.ago) + + current_user.update_attribute(:last_activity, Time.now) + session[:last_activity] = Time.now end # Many plugins can be turned on and off on the fly with a `use_` configuration option. @@ -64,11 +64,11 @@ class ApplicationController < ActionController::Base end def items_per_page - if params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 500 - @per_page = params[:per_page].to_i - else - @per_page = 20 - end + @per_page = if params[:per_page] && params[:per_page].to_i > 0 && params[:per_page].to_i <= 500 + params[:per_page].to_i + else + 20 + end end # Set timezone according to foodcoop preference. diff --git a/app/controllers/article_categories_controller.rb b/app/controllers/article_categories_controller.rb index bfa601d3..810bb3ce 100644 --- a/app/controllers/article_categories_controller.rb +++ b/app/controllers/article_categories_controller.rb @@ -4,17 +4,17 @@ class ArticleCategoriesController < ApplicationController before_action :authenticate_article_meta def create - create!(:notice => I18n.t('article_categories.create.notice')) { article_categories_path } + create!(notice: I18n.t('article_categories.create.notice')) { article_categories_path } end def update - update!(:notice => I18n.t('article_categories.update.notice')) { article_categories_path } + update!(notice: I18n.t('article_categories.update.notice')) { article_categories_path } end def destroy destroy! - rescue => error - redirect_to article_categories_path, alert: I18n.t('article_categories.destroy.error', message: error.message) + rescue StandardError => e + redirect_to article_categories_path, alert: I18n.t('article_categories.destroy.error', message: e.message) end protected diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 16b506e8..232391cf 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -2,24 +2,24 @@ class ArticlesController < ApplicationController before_action :authenticate_article_meta, :find_supplier def index - if params['sort'] - sort = case params['sort'] - when "name" then "articles.name" - when "unit" then "articles.unit" - when "article_category" then "article_categories.name" - when "note" then "articles.note" - when "availability" then "articles.availability" - when "name_reverse" then "articles.name DESC" - when "unit_reverse" then "articles.unit DESC" - when "article_category_reverse" then "article_categories.name DESC" - when "note_reverse" then "articles.note DESC" - when "availability_reverse" then "articles.availability DESC" + sort = if params['sort'] + case params['sort'] + when 'name' then 'articles.name' + when 'unit' then 'articles.unit' + when 'article_category' then 'article_categories.name' + when 'note' then 'articles.note' + when 'availability' then 'articles.availability' + when 'name_reverse' then 'articles.name DESC' + when 'unit_reverse' then 'articles.unit DESC' + when 'article_category_reverse' then 'article_categories.name DESC' + when 'note_reverse' then 'articles.note DESC' + when 'availability_reverse' then 'articles.availability DESC' end - else - sort = "article_categories.name, articles.name" - end + else + 'article_categories.name, articles.name' + end - @articles = Article.undeleted.where(supplier_id: @supplier, :type => nil).includes(:article_category).order(sort) + @articles = Article.undeleted.where(supplier_id: @supplier, type: nil).includes(:article_category).order(sort) if request.format.csv? send_data ArticlesCsv.new(@articles, encoding: 'utf-8').to_csv, filename: 'articles.csv', type: 'text/csv' @@ -32,31 +32,31 @@ class ArticlesController < ApplicationController respond_to do |format| format.html - format.js { render :layout => false } + format.js { render layout: false } end end def new - @article = @supplier.articles.build(:tax => FoodsoftConfig[:tax_default]) - render :layout => false + @article = @supplier.articles.build(tax: FoodsoftConfig[:tax_default]) + render layout: false end def copy @article = @supplier.articles.find(params[:article_id]).dup - render :layout => false + render layout: false end def edit @article = Article.find(params[:id]) - render :action => 'new', :layout => false + render action: 'new', layout: false end def create @article = Article.new(params[:article]) if @article.valid? && @article.save - render :layout => false + render layout: false else - render :action => 'new', :layout => false + render action: 'new', layout: false end end @@ -65,9 +65,9 @@ class ArticlesController < ApplicationController @article = Article.find(params[:id]) if @article.update(params[:article]) - render :layout => false + render layout: false else - render :action => 'new', :layout => false + render action: 'new', layout: false end end @@ -75,7 +75,7 @@ class ArticlesController < ApplicationController def destroy @article = Article.find(params[:id]) @article.mark_as_deleted unless @order = @article.in_open_order # If article is in an active Order, the Order will be returned - render :layout => false + render layout: false end # Renders a form for editing all articles from a supplier @@ -87,19 +87,17 @@ class ArticlesController < ApplicationController def update_all invalid_articles = false - begin - Article.transaction do - unless params[:articles].blank? - # Update other article attributes... - @articles = Article.find(params[:articles].keys) - @articles.each do |article| - unless article.update(params[:articles][article.id.to_s]) - invalid_articles = true unless invalid_articles # Remember that there are validation errors - end + Article.transaction do + if params[:articles].present? + # Update other article attributes... + @articles = Article.find(params[:articles].keys) + @articles.each do |article| + unless article.update(params[:articles][article.id.to_s]) + invalid_articles ||= true # Remember that there are validation errors end - - raise ActiveRecord::Rollback if invalid_articles # Rollback all changes end + + raise ActiveRecord::Rollback if invalid_articles # Rollback all changes end end @@ -134,32 +132,31 @@ class ArticlesController < ApplicationController end end # action succeded - redirect_to supplier_articles_url(@supplier, :per_page => params[:per_page]) - rescue => error - redirect_to supplier_articles_url(@supplier, :per_page => params[:per_page]), - :alert => I18n.t('errors.general_msg', :msg => error) + redirect_to supplier_articles_url(@supplier, per_page: params[:per_page]) + rescue StandardError => e + redirect_to supplier_articles_url(@supplier, per_page: params[:per_page]), + alert: I18n.t('errors.general_msg', msg: e) end # lets start with parsing articles from uploaded file, yeah # Renders the upload form - def upload - end + def upload; end # Update articles from a spreadsheet def parse_upload 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[:outlist_absent] = (params[:articles]['outlist_absent'] == '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, type, options + @updated_article_pairs, @outlisted_articles, @new_articles = @supplier.sync_from_file uploaded_file.tempfile, + options 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 @ignored_article_count = 0 - rescue => error - redirect_to upload_supplier_articles_path(@supplier), :alert => I18n.t('errors.general_msg', :msg => error.message) + rescue StandardError => e + redirect_to upload_supplier_articles_path(@supplier), alert: I18n.t('errors.general_msg', msg: e.message) end # sync all articles with the external database @@ -167,13 +164,14 @@ class ArticlesController < ApplicationController def sync # check if there is an shared_supplier unless @supplier.shared_supplier - redirect_to supplier_articles_url(@supplier), :alert => I18n.t('articles.controller.sync.shared_alert', :supplier => @supplier.name) + redirect_to supplier_articles_url(@supplier), + alert: I18n.t('articles.controller.sync.shared_alert', supplier: @supplier.name) end # sync articles against external database @updated_article_pairs, @outlisted_articles, @new_articles = @supplier.sync_all - if @updated_article_pairs.empty? && @outlisted_articles.empty? && @new_articles.empty? - redirect_to supplier_articles_path(@supplier), :notice => I18n.t('articles.controller.sync.notice') - end + return unless @updated_article_pairs.empty? && @outlisted_articles.empty? && @new_articles.empty? + + redirect_to supplier_articles_path(@supplier), notice: I18n.t('articles.controller.sync.notice') end # Updates, deletes articles when upload or sync form is submitted @@ -188,7 +186,7 @@ class ArticlesController < ApplicationController # delete articles begin @outlisted_articles.each(&:mark_as_deleted) - rescue + rescue StandardError # raises an exception when used in current order has_error = true end @@ -200,15 +198,15 @@ class ArticlesController < ApplicationController raise ActiveRecord::Rollback if has_error end - if !has_error - redirect_to supplier_articles_path(@supplier), notice: I18n.t('articles.controller.update_sync.notice') - else + if has_error @updated_article_pairs = @updated_articles.map do |article| orig_article = Article.find(article.id) [article, orig_article.unequal_attributes(article)] end flash.now.alert = I18n.t('articles.controller.error_invalid') render params[:from_action] == 'sync' ? :sync : :parse_upload + else + redirect_to supplier_articles_path(@supplier), notice: I18n.t('articles.controller.update_sync.notice') end end @@ -220,18 +218,18 @@ class ArticlesController < ApplicationController q[:name_cont_all] = params.fetch(:name_cont_all_joined, '').split(' ') search = @supplier.shared_supplier.shared_articles.ransack(q) @articles = search.result.page(params[:page]).per(10) - render :layout => false + render layout: false end # fills a form whith values of the selected shared_article # when the direct parameter is set and the article is valid, it is imported directly def import @article = SharedArticle.find(params[:shared_article_id]).build_new_article(@supplier) - @article.article_category_id = params[:article_category_id] unless params[:article_category_id].blank? - if params[:direct] && !params[:article_category_id].blank? && @article.valid? && @article.save - render :action => 'create', :layout => false + @article.article_category_id = params[:article_category_id] if params[:article_category_id].present? + if params[:direct] && params[:article_category_id].present? && @article.valid? && @article.save + render action: 'create', layout: false else - render :action => 'new', :layout => false + render action: 'new', layout: false end end diff --git a/app/controllers/concerns/auth.rb b/app/controllers/concerns/auth.rb index 277acd69..edf6ec6f 100644 --- a/app/controllers/concerns/auth.rb +++ b/app/controllers/concerns/auth.rb @@ -9,15 +9,19 @@ module Concerns::Auth def current_user # check if there is a valid session and return the logged-in user (its object) - if session[:user_id] && params[:foodcoop] - # for shared-host installations. check if the cookie-subdomain fits to request. - @current_user ||= User.undeleted.find_by_id(session[:user_id]) if session[:scope] == FoodsoftConfig.scope - end + return unless session[:user_id] && params[:foodcoop] + + # for shared-host installations. check if the cookie-subdomain fits to request. + @current_user ||= User.undeleted.find_by_id(session[:user_id]) if session[:scope] == FoodsoftConfig.scope end def deny_access session[:return_to] = request.original_url - redirect_to root_url, alert: I18n.t('application.controller.error_denied', sign_in: ActionController::Base.helpers.link_to(t('application.controller.error_denied_sign_in'), login_path)) + redirect_to root_url, + alert: I18n.t('application.controller.error_denied', + sign_in: ActionController::Base.helpers.link_to( + t('application.controller.error_denied_sign_in'), login_path + )) end private @@ -47,12 +51,7 @@ module Concerns::Auth def authenticate(role = 'any') # Attempt to retrieve authenticated user from controller instance or session... - if !current_user - # No user at all: redirect to login page. - logout - session[:return_to] = request.original_url - redirect_to_login :alert => I18n.t('application.controller.error_authn') - else + if current_user # We have an authenticated user, now check role... # Roles gets the user through his memberships. hasRole = case role @@ -73,6 +72,11 @@ module Concerns::Auth else deny_access end + else + # No user at all: redirect to login page. + logout + session[:return_to] = request.original_url + redirect_to_login alert: I18n.t('application.controller.error_authn') end end @@ -116,13 +120,13 @@ module Concerns::Auth # if fails the user will redirected to startpage def authenticate_membership_or_admin(group_id = params[:id]) @group = Group.find(group_id) - unless @group.member?(@current_user) || @current_user.role_admin? - redirect_to root_path, alert: I18n.t('application.controller.error_members_only') - end + return if @group.member?(@current_user) || @current_user.role_admin? + + redirect_to root_path, alert: I18n.t('application.controller.error_members_only') end def authenticate_or_token(prefix, role = 'any') - if not params[:token].blank? + if params[:token].present? begin TokenVerifier.new(prefix).verify(params[:token]) rescue ActiveSupport::MessageVerifier::InvalidSignature diff --git a/app/controllers/concerns/auth_api.rb b/app/controllers/concerns/auth_api.rb index 2c80dddf..fc16a2c2 100644 --- a/app/controllers/concerns/auth_api.rb +++ b/app/controllers/concerns/auth_api.rb @@ -36,9 +36,9 @@ module Concerns::AuthApi # Make sure that at least one the given OAuth scopes is valid for the current user's permissions. # @raise Api::Errors::PermissionsRequired def doorkeeper_authorize_roles!(*scopes) - unless scopes.any? { |scope| doorkeeper_scope_permitted?(scope) } - raise Api::Errors::PermissionRequired.new('Forbidden, no permission') - end + return if scopes.any? { |scope| doorkeeper_scope_permitted?(scope) } + + raise Api::Errors::PermissionRequired, 'Forbidden, no permission' end # Check whether a given OAuth scope is permitted for the current user. @@ -48,9 +48,7 @@ module Concerns::AuthApi def doorkeeper_scope_permitted?(scope) scope_parts = scope.split(':') # user sub-scopes like +config:user+ are always permitted - if scope_parts.last == 'user' - return true - end + return true if scope_parts.last == 'user' case scope_parts.first when 'user' then return true # access to the current user's own profile @@ -64,8 +62,8 @@ module Concerns::AuthApi end case scope - when 'orders:read' then return true - when 'orders:write' then return current_user.role_orders? + when 'orders:read' then true + when 'orders:write' then current_user.role_orders? end end end diff --git a/app/controllers/concerns/foodcoop_scope.rb b/app/controllers/concerns/foodcoop_scope.rb index 0a8e382e..7a99adf9 100644 --- a/app/controllers/concerns/foodcoop_scope.rb +++ b/app/controllers/concerns/foodcoop_scope.rb @@ -24,12 +24,12 @@ module Concerns::FoodcoopScope elsif FoodsoftConfig.allowed_foodcoop? foodcoop FoodsoftConfig.select_foodcoop foodcoop else - raise ActionController::RoutingError.new 'Foodcoop Not Found' + raise ActionController::RoutingError, 'Foodcoop Not Found' end end # Always stay in foodcoop url scope - def default_url_options(options = {}) + def default_url_options(_options = {}) super().merge({ foodcoop: FoodsoftConfig.scope }) end end diff --git a/app/controllers/concerns/locale.rb b/app/controllers/concerns/locale.rb index 22686c15..6a9736fb 100644 --- a/app/controllers/concerns/locale.rb +++ b/app/controllers/concerns/locale.rb @@ -18,7 +18,7 @@ module Concerns::Locale end def browser_language - request.env['HTTP_ACCEPT_LANGUAGE'] ? request.env['HTTP_ACCEPT_LANGUAGE'].scan(/^[a-z]{2}/).first : nil + request.env['HTTP_ACCEPT_LANGUAGE']&.scan(/^[a-z]{2}/)&.first end def default_language @@ -30,7 +30,7 @@ module Concerns::Locale def select_language_according_to_priority language = explicitly_requested_language || session_language || user_settings_language language ||= browser_language unless FoodsoftConfig[:ignore_browser_locale] - language.presence&.to_sym unless language.blank? + language.presence&.to_sym if language.present? end def available_locales @@ -38,11 +38,11 @@ module Concerns::Locale end def set_locale - if available_locales.include?(select_language_according_to_priority) - ::I18n.locale = select_language_according_to_priority - else - ::I18n.locale = default_language - end + ::I18n.locale = if available_locales.include?(select_language_according_to_priority) + select_language_according_to_priority + else + default_language + end locale = session[:locale] = ::I18n.locale logger.info("Set locale to #{locale}") diff --git a/app/controllers/concerns/send_order_pdf.rb b/app/controllers/concerns/send_order_pdf.rb index 09225b7c..283512da 100644 --- a/app/controllers/concerns/send_order_pdf.rb +++ b/app/controllers/concerns/send_order_pdf.rb @@ -3,7 +3,7 @@ module Concerns::SendOrderPdf protected - def send_order_pdf order, document + def send_order_pdf(order, document) klass = case document when 'groups' then OrderByGroups when 'articles' then OrderByArticles diff --git a/app/controllers/deliveries_controller.rb b/app/controllers/deliveries_controller.rb index 0ecacc9c..15900022 100644 --- a/app/controllers/deliveries_controller.rb +++ b/app/controllers/deliveries_controller.rb @@ -1,5 +1,5 @@ class DeliveriesController < ApplicationController - before_action :find_supplier, :exclude => :fill_new_stock_article_form + before_action :find_supplier, exclude: :fill_new_stock_article_form def index @deliveries = @supplier.deliveries.order('date DESC') @@ -15,6 +15,10 @@ class DeliveriesController < ApplicationController @delivery.date = Date.today # TODO: move to model/database end + def edit + @delivery = Delivery.find(params[:id]) + end + def create @delivery = Delivery.new(params[:delivery]) @@ -22,14 +26,10 @@ class DeliveriesController < ApplicationController flash[:notice] = I18n.t('deliveries.create.notice') redirect_to [@supplier, @delivery] else - render :action => "new" + render action: 'new' end end - def edit - @delivery = Delivery.find(params[:id]) - end - def update @delivery = Delivery.find(params[:id]) @@ -37,7 +37,7 @@ class DeliveriesController < ApplicationController flash[:notice] = I18n.t('deliveries.update.notice') redirect_to [@supplier, @delivery] else - render :action => "edit" + render action: 'edit' end end @@ -52,18 +52,18 @@ class DeliveriesController < ApplicationController def add_stock_change @stock_change = StockChange.new @stock_change.stock_article = StockArticle.find(params[:stock_article_id]) - render :layout => false + render layout: false end def form_on_stock_article_create # See publish/subscribe design pattern in /doc. @stock_article = StockArticle.find(params[:id]) - render :layout => false + render layout: false end def form_on_stock_article_update # See publish/subscribe design pattern in /doc. @stock_article = StockArticle.find(params[:id]) - render :layout => false + render layout: false end end diff --git a/app/controllers/feedback_controller.rb b/app/controllers/feedback_controller.rb index ada72859..b4e5ea7e 100644 --- a/app/controllers/feedback_controller.rb +++ b/app/controllers/feedback_controller.rb @@ -1,13 +1,12 @@ class FeedbackController < ApplicationController - def new - end + def new; end def create if params[:message].present? Mailer.feedback(current_user, params[:message]).deliver_now - redirect_to root_url, notice: t('feedback.create.notice') + redirect_to root_url, notice: t('.notice') else - render :action => 'new' + render action: 'new' end end end diff --git a/app/controllers/finance/balancing_controller.rb b/app/controllers/finance/balancing_controller.rb index 4f23ac4f..fad07684 100644 --- a/app/controllers/finance/balancing_controller.rb +++ b/app/controllers/finance/balancing_controller.rb @@ -5,39 +5,39 @@ class Finance::BalancingController < Finance::BaseController def new @order = Order.find(params[:order_id]) - flash.now.alert = t('finance.balancing.new.alert') if @order.closed? + flash.now.alert = t('.alert') if @order.closed? @comments = @order.comments + @articles = @order.order_articles.ordered_or_member.includes(:article, :article_price, group_order_articles: { group_order: :ordergroup }) sort_param = params['sort'] || 'name' @articles = case sort_param - when 'name' then + when 'name' @articles.order('articles.name ASC') - when 'name_reverse' then + when 'name_reverse' @articles.order('articles.name DESC') - when 'order_number' then + when 'order_number' @articles.order('articles.order_number ASC') - when 'order_number_reverse' then + when 'order_number_reverse' @articles.order('articles.order_number DESC') else @articles end - render layout: false if request.xhr? end def new_on_order_article_create # See publish/subscribe design pattern in /doc. @order_article = OrderArticle.find(params[:order_article_id]) - render :layout => false + render layout: false end def new_on_order_article_update # See publish/subscribe design pattern in /doc. @order_article = OrderArticle.find(params[:order_article_id]) - render :layout => false + render layout: false end def update_summary @@ -46,29 +46,29 @@ class Finance::BalancingController < Finance::BaseController def edit_note @order = Order.find(params[:id]) - render :layout => false + render layout: false end def update_note @order = Order.find(params[:id]) if @order.update(params[:order]) - render :layout => false + render layout: false else - render :action => :edit_note, :layout => false + render action: :edit_note, layout: false end end def edit_transport @order = Order.find(params[:id]) - render :layout => false + render layout: false end def update_transport @order = Order.find(params[:id]) @order.update!(params[:order]) redirect_to new_finance_order_path(order_id: @order.id) - rescue => error - redirect_to new_finance_order_path(order_id: @order.id), alert: t('errors.general_msg', msg: error.message) + rescue StandardError => e + redirect_to new_finance_order_path(order_id: @order.id), alert: t('errors.general_msg', msg: e.message) end # before the order will booked, a view lists all Ordergroups and its order_prices @@ -81,18 +81,18 @@ class Finance::BalancingController < Finance::BaseController @order = Order.find(params[:id]) @type = FinancialTransactionType.find_by_id(params.permit(:type)[:type]) @order.close!(@current_user, @type) - redirect_to finance_order_index_url, notice: t('finance.balancing.close.notice') - rescue => error - redirect_to new_finance_order_url(order_id: @order.id), alert: t('finance.balancing.close.alert', message: error.message) + redirect_to finance_order_index_url, notice: t('.notice') + rescue StandardError => e + redirect_to new_finance_order_url(order_id: @order.id), alert: t('.alert', message: e.message) end # Close the order directly, without automaticly updating ordergroups account balances def close_direct @order = Order.find(params[:id]) @order.close_direct!(@current_user) - redirect_to finance_order_index_url, notice: t('finance.balancing.close_direct.notice') - rescue => error - redirect_to finance_order_index_url, alert: t('finance.balancing.close_direct.alert', message: error.message) + redirect_to finance_order_index_url, notice: t('.notice') + rescue StandardError => e + redirect_to finance_order_index_url, alert: t('.alert', message: e.message) end def close_all_direct_with_invoice @@ -103,8 +103,8 @@ class Finance::BalancingController < Finance::BaseController count += 1 end end - redirect_to finance_order_index_url, notice: t('finance.balancing.close_all_direct_with_invoice.notice', count: count) - rescue => error - redirect_to finance_order_index_url, alert: t('errors.general_msg', msg: error.message) + redirect_to finance_order_index_url, notice: t('.notice', count: count) + rescue StandardError => e + redirect_to finance_order_index_url, alert: t('errors.general_msg', msg: e.message) end end diff --git a/app/controllers/finance/bank_accounts_controller.rb b/app/controllers/finance/bank_accounts_controller.rb index 66d9fddd..81403f6a 100644 --- a/app/controllers/finance/bank_accounts_controller.rb +++ b/app/controllers/finance/bank_accounts_controller.rb @@ -8,8 +8,8 @@ class Finance::BankAccountsController < Finance::BaseController @bank_account = BankAccount.find(params[:id]) count = @bank_account.assign_unlinked_transactions redirect_to finance_bank_account_transactions_url(@bank_account), notice: t('.notice', count: count) - rescue => error - redirect_to finance_bank_account_transactions_url(@bank_account), alert: t('errors.general_msg', msg: error.message) + rescue StandardError => e + redirect_to finance_bank_account_transactions_url(@bank_account), alert: t('errors.general_msg', msg: e.message) end def import @@ -33,8 +33,8 @@ class Finance::BankAccountsController < Finance::BaseController end needs_redirect = ok - rescue => error - flash.alert = t('errors.general_msg', msg: error.message) + rescue StandardError => e + flash.alert = t('errors.general_msg', msg: e.message) needs_redirect = true ensure return unless needs_redirect diff --git a/app/controllers/finance/bank_transactions_controller.rb b/app/controllers/finance/bank_transactions_controller.rb index 53c35168..22b38d06 100644 --- a/app/controllers/finance/bank_transactions_controller.rb +++ b/app/controllers/finance/bank_transactions_controller.rb @@ -3,26 +3,30 @@ class Finance::BankTransactionsController < ApplicationController inherit_resources def index - if params["sort"] - sort = case params["sort"] - when "date" then "date" - when "amount" then "amount" - when "financial_link" then "financial_link_id" - when "date_reverse" then "date DESC" - when "amount_reverse" then "amount DESC" - when "financial_link_reverse" then "financial_link_id DESC" + sort = if params['sort'] + case params['sort'] + when 'date' then 'date' + when 'amount' then 'amount' + when 'financial_link' then 'financial_link_id' + when 'date_reverse' then 'date DESC' + when 'amount_reverse' then 'amount DESC' + when 'financial_link_reverse' then 'financial_link_id DESC' end - else - sort = "date DESC" - end + else + 'date DESC' + end @bank_account = BankAccount.find(params[:bank_account_id]) @bank_transactions_all = @bank_account.bank_transactions.order(sort).includes(:financial_link) - @bank_transactions_all = @bank_transactions_all.where('reference LIKE ? OR text LIKE ?', "%#{params[:query]}%", "%#{params[:query]}%") unless params[:query].nil? + unless params[:query].nil? + @bank_transactions_all = @bank_transactions_all.where('reference LIKE ? OR text LIKE ?', "%#{params[:query]}%", + "%#{params[:query]}%") + end @bank_transactions = @bank_transactions_all.page(params[:page]).per(@per_page) respond_to do |format| - format.js; format.html { render } + format.js + format.html { render } format.csv do send_data BankTransactionsCsv.new(@bank_transactions_all).to_csv, filename: 'transactions.csv', type: 'text/csv' end diff --git a/app/controllers/finance/financial_links_controller.rb b/app/controllers/finance/financial_links_controller.rb index 17d8399a..c78a79b3 100644 --- a/app/controllers/finance/financial_links_controller.rb +++ b/app/controllers/finance/financial_links_controller.rb @@ -1,5 +1,5 @@ class Finance::FinancialLinksController < Finance::BaseController - before_action :find_financial_link, except: [:create, :incomplete] + before_action :find_financial_link, except: %i[create incomplete] def show @items = @financial_link.bank_transactions.map do |bt| @@ -37,7 +37,7 @@ class Finance::FinancialLinksController < Finance::BaseController def create @financial_link = FinancialLink.first_unused_or_create - if params[:bank_transaction] then + if params[:bank_transaction] bank_transaction = BankTransaction.find(params[:bank_transaction]) bank_transaction.update_attribute :financial_link, @financial_link end @@ -72,14 +72,16 @@ class Finance::FinancialLinksController < Finance::BaseController def create_financial_transaction financial_transaction = FinancialTransaction.new(financial_transaction_params) - financial_transaction.ordergroup.add_financial_transaction! financial_transaction.amount, financial_transaction.note, current_user, financial_transaction.financial_transaction_type, @financial_link + financial_transaction.ordergroup.add_financial_transaction! financial_transaction.amount, + financial_transaction.note, current_user, financial_transaction.financial_transaction_type, @financial_link redirect_to finance_link_url(@financial_link), notice: t('.notice') - rescue => error - redirect_to finance_link_url(@financial_link), alert: t('errors.general_msg', msg: error) + rescue StandardError => e + redirect_to finance_link_url(@financial_link), alert: t('errors.general_msg', msg: e) end def index_financial_transaction - @financial_transactions = FinancialTransaction.without_financial_link.includes(:financial_transaction_type, :ordergroup) + @financial_transactions = FinancialTransaction.without_financial_link.includes(:financial_transaction_type, + :ordergroup) end def add_financial_transaction @@ -123,7 +125,7 @@ class Finance::FinancialLinksController < Finance::BaseController end def find_best_fitting_ordergroup_id_for_financial_link(financial_link_id) - FinancialTransaction.joins(<<-SQL).order(created_on: :desc).pluck(:ordergroup_id).first + FinancialTransaction.joins(<<-SQL).order(created_on: :desc).pick(:ordergroup_id) JOIN bank_transactions a ON financial_transactions.financial_link_id = a.financial_link_id JOIN bank_transactions b ON a.iban = b.iban AND b.financial_link_id = #{financial_link_id.to_i} SQL diff --git a/app/controllers/finance/financial_transactions_controller.rb b/app/controllers/finance/financial_transactions_controller.rb index e0c53e19..6b06cbee 100644 --- a/app/controllers/finance/financial_transactions_controller.rb +++ b/app/controllers/finance/financial_transactions_controller.rb @@ -1,22 +1,22 @@ class Finance::FinancialTransactionsController < ApplicationController before_action :authenticate_finance - before_action :find_ordergroup, :except => [:new_collection, :create_collection, :index_collection] + before_action :find_ordergroup, except: %i[new_collection create_collection index_collection] inherit_resources # belongs_to :ordergroup def index - if params['sort'] - sort = case params['sort'] - when "date" then "created_on" - when "note" then "note" - when "amount" then "amount" - when "date_reverse" then "created_on DESC" - when "note_reverse" then "note DESC" - when "amount_reverse" then "amount DESC" + sort = if params['sort'] + case params['sort'] + when 'date' then 'created_on' + when 'note' then 'note' + when 'amount' then 'amount' + when 'date_reverse' then 'created_on DESC' + when 'note_reverse' then 'note DESC' + when 'amount_reverse' then 'amount DESC' end - else - sort = "created_on DESC" - end + else + 'created_on DESC' + end @q = FinancialTransaction.ransack(params[:q]) @financial_transactions_all = @q.result(distinct: true).includes(:user).order(sort) @@ -26,9 +26,11 @@ class Finance::FinancialTransactionsController < ApplicationController @financial_transactions = @financial_transactions_all.page(params[:page]).per(@per_page) respond_to do |format| - format.js; format.html { render } + format.js + format.html { render } format.csv do - send_data FinancialTransactionsCsv.new(@financial_transactions_all).to_csv, filename: 'transactions.csv', type: 'text/csv' + send_data FinancialTransactionsCsv.new(@financial_transactions_all).to_csv, filename: 'transactions.csv', + type: 'text/csv' end end end @@ -38,11 +40,11 @@ class Finance::FinancialTransactionsController < ApplicationController end def new - if @ordergroup - @financial_transaction = @ordergroup.financial_transactions.build - else - @financial_transaction = FinancialTransaction.new - end + @financial_transaction = if @ordergroup + @ordergroup.financial_transactions.build + else + FinancialTransaction.new + end end def create @@ -53,16 +55,18 @@ class Finance::FinancialTransactionsController < ApplicationController else @financial_transaction.save! end - redirect_to finance_group_transactions_path(@ordergroup), notice: I18n.t('finance.financial_transactions.controller.create.notice') - rescue ActiveRecord::RecordInvalid => error - flash.now[:alert] = error.message - render :action => :new + redirect_to finance_group_transactions_path(@ordergroup), + notice: I18n.t('finance.financial_transactions.controller.create.notice') + rescue ActiveRecord::RecordInvalid => e + flash.now[:alert] = e.message + render action: :new end def destroy transaction = FinancialTransaction.find(params[:id]) transaction.revert!(current_user) - redirect_to finance_group_transactions_path(transaction.ordergroup), notice: t('finance.financial_transactions.controller.destroy.notice') + redirect_to finance_group_transactions_path(transaction.ordergroup), + notice: t('finance.financial_transactions.controller.destroy.notice') end def new_collection @@ -88,17 +92,17 @@ class Finance::FinancialTransactionsController < ApplicationController params[:financial_transactions].each do |trans| # ignore empty amount fields ... - unless trans[:amount].blank? - amount = LocalizeInput.parse(trans[:amount]).to_f - note = params[:note] - ordergroup = Ordergroup.find(trans[:ordergroup_id]) - if params[:set_balance] - note += " (#{amount})" - amount -= ordergroup.financial_transaction_class_balance(type.financial_transaction_class) - end - ordergroup.add_financial_transaction!(amount, note, @current_user, type, financial_link) - foodcoop_amount -= amount + next if trans[:amount].blank? + + amount = LocalizeInput.parse(trans[:amount]).to_f + note = params[:note] + ordergroup = Ordergroup.find(trans[:ordergroup_id]) + if params[:set_balance] + note += " (#{amount})" + amount -= ordergroup.financial_transaction_class_balance(type.financial_transaction_class) end + ordergroup.add_financial_transaction!(amount, note, @current_user, type, financial_link) + foodcoop_amount -= amount end if params[:create_foodcoop_transaction] @@ -107,7 +111,7 @@ class Finance::FinancialTransactionsController < ApplicationController user: @current_user, amount: foodcoop_amount, note: params[:note], - financial_link: financial_link, + financial_link: financial_link }) ft.save! end @@ -117,8 +121,8 @@ class Finance::FinancialTransactionsController < ApplicationController url = financial_link ? finance_link_url(financial_link.id) : finance_ordergroups_url redirect_to url, notice: I18n.t('finance.financial_transactions.controller.create_collection.notice') - rescue => error - flash.now[:alert] = error.message + rescue StandardError => e + flash.now[:alert] = e.message render action: :new_collection end diff --git a/app/controllers/finance/invoices_controller.rb b/app/controllers/finance/invoices_controller.rb index d981277b..d70b92ec 100644 --- a/app/controllers/finance/invoices_controller.rb +++ b/app/controllers/finance/invoices_controller.rb @@ -1,15 +1,16 @@ class Finance::InvoicesController < ApplicationController before_action :authenticate_finance_or_invoices - before_action :find_invoice, only: [:show, :edit, :update, :destroy] - before_action :ensure_can_edit, only: [:edit, :update, :destroy] + before_action :find_invoice, only: %i[show edit update destroy] + before_action :ensure_can_edit, only: %i[edit update destroy] def index @invoices_all = Invoice.includes(:supplier, :deliveries, :orders).order('date DESC') @invoices = @invoices_all.page(params[:page]).per(@per_page) respond_to do |format| - format.js; format.html { render } + format.js + format.html { render } format.csv do send_data InvoicesCsv.new(@invoices_all).to_csv, filename: 'invoices.csv', type: 'text/csv' end @@ -20,11 +21,10 @@ class Finance::InvoicesController < ApplicationController @suppliers = Supplier.includes(:invoices).where('invoices.paid_on IS NULL').references(:invoices) end - def show - end + def show; end def new - @invoice = Invoice.new :supplier_id => params[:supplier_id] + @invoice = Invoice.new supplier_id: params[:supplier_id] @invoice.deliveries << Delivery.find_by_id(params[:delivery_id]) if params[:delivery_id] @invoice.orders << Order.find_by_id(params[:order_id]) if params[:order_id] fill_deliveries_and_orders_collection @invoice.id, @invoice.supplier_id @@ -36,12 +36,14 @@ class Finance::InvoicesController < ApplicationController def form_on_supplier_id_change fill_deliveries_and_orders_collection params[:invoice_id], params[:supplier_id] - render :layout => false + render layout: false end def fill_deliveries_and_orders_collection(invoice_id, supplier_id) - @deliveries_collection = Delivery.where('invoice_id = ? OR (invoice_id IS NULL AND supplier_id = ?)', invoice_id, supplier_id).order(date: :desc).limit(25) - @orders_collection = Order.where('invoice_id = ? OR (invoice_id IS NULL AND supplier_id = ?)', invoice_id, supplier_id).order(ends: :desc).limit(25) + @deliveries_collection = Delivery.where('invoice_id = ? OR (invoice_id IS NULL AND supplier_id = ?)', invoice_id, + supplier_id).order(date: :desc).limit(25) + @orders_collection = Order.where('invoice_id = ? OR (invoice_id IS NULL AND supplier_id = ?)', invoice_id, + supplier_id).order(ends: :desc).limit(25) end def create @@ -58,7 +60,7 @@ class Finance::InvoicesController < ApplicationController end else fill_deliveries_and_orders_collection @invoice.id, @invoice.supplier_id - render :action => "new" + render action: 'new' end end @@ -81,7 +83,7 @@ class Finance::InvoicesController < ApplicationController @invoice = Invoice.find(params[:invoice_id]) type = MIME::Types[@invoice.attachment_mime].first filename = "invoice_#{@invoice.id}_attachment.#{type.preferred_extension}" - send_data(@invoice.attachment_data, :filename => filename, :type => type) + send_data(@invoice.attachment_data, filename: filename, type: type) end private @@ -92,8 +94,8 @@ class Finance::InvoicesController < ApplicationController # Returns true if @current_user can edit the invoice.. def ensure_can_edit - unless @invoice.user_can_edit?(current_user) - deny_access - end + return if @invoice.user_can_edit?(current_user) + + deny_access end end diff --git a/app/controllers/finance/ordergroups_controller.rb b/app/controllers/finance/ordergroups_controller.rb index d334f223..58ba0c36 100644 --- a/app/controllers/finance/ordergroups_controller.rb +++ b/app/controllers/finance/ordergroups_controller.rb @@ -1,11 +1,11 @@ class Finance::OrdergroupsController < Finance::BaseController def index - m = /^(?
Desde aquí puedes escribir un mensaje a los miembros de tu cooperativa Foodcoop. Recuerda habilitar en %{profile_link} tus detalles de contacto para que sean visibles.
" @@ -930,7 +1055,6 @@ es: action_save: Guardar pedido new_funds: Nuevo balance de cuenta price: Precio - price_per_base_unit: Precio de base reset_article_search: Reinicia la búsqueda search_article: Busca artículos... sum_amount: Cantidad actual @@ -988,10 +1112,12 @@ es: application: edit_user: Edita usuario nick_fallback: "(no tiene apodo)" + role_admin: Admin role_article_meta: Artículos role_finance: Finanzas role_invoices: Facturas role_orders: Pedidos + role_pickups: Días de recogida role_suppliers: Proveedores show_google_maps: Muéstralo en Google maps sort_by: Ordena por %{text} @@ -1001,12 +1127,14 @@ es: orders: old_price: Precio anterior option_choose: Elige proveedor/stock + option_stock: Existencias order_pdf: Crea PDF submit: invite: create: envía invitación tasks: required_users: "Aún se necesitan %{count} miembros!" + task_title: "%{name} (%{duration}h)" home: apple_bar: desc: 'Esto muestra la proporción de tareas completadas respecto al volumen de pedidos de tu grupo de pedido en comparación con el promedio en Foodcoop. En práctica: por cada %{amount} de pedidos totales, tú deberías hacer una tarea!' @@ -1015,8 +1143,9 @@ es: warning: Cuidado, si tienes menos de %{threshold} puntos-manzana no puedes hacer un pedido! changes_saved: Guarda los cambios. index: + due_date_format: "%A %d %B" my_ordergroup: - last_update: La última actualización fue hace %{when} + last_update: La última actualización fue hace %{when} title: Mi grupo de pedido transactions: title: Últimas transacciones @@ -1048,12 +1177,21 @@ es: title: Mi Perfil user: since: "(miembro para %{when})" + title: "%{user}" + reference_calculator: + transaction_types_headline: Propósito + placeholder: Por favor, introduzca primero las cantidades que desea transferir en cada campo, para ver la referencia que debe utilizar para esa transacción. + text0: Por favor transfiera + text1: con la referencia + text2: a la cuenta bancaria + title: Calculador de referencia start_nav: admin: Administración finances: accounts: Actualizar cuentas settle: Pedidos de la cuenta title: Finanzas + foodcoop: Foodcoop members: Miembros new_ordergroup: Nuevo grupo de pedido new_user: Nuevo miembro @@ -1081,19 +1219,31 @@ es: js: ordering: confirm_change: Las modificaciones sobre este pedido se perderán cuando cambies el pedido. ¿Quieres perder los cambios que has hecho y continuar? + trix_editor: + file_size_alert: '¡El archivo adjunto es demasiado grande! El tamaño máximo es de 512Mb' layouts: email: + footer_1_separator: "--" + footer_2_foodsoft: 'Foodsoft: %{url}' + footer_3_homepage: 'Foodcoop: %{url}' footer_4_help: 'Ayuda: %{url}' help: 'Ayuda' + foodsoft: Foodsoft footer: revision: revisión %{revision} header: feedback: desc: '¿Encontrase algún error? ¿Sugerencias? ¿Ideas?' + title: Sugerencias help: Ayuda logout: Salir ordergroup: Mis grupos de pedido profile: Edita perfil + reference_calculator: Calculador de referencia + logo: "foodsoft" + lib: + render_pdf: + page: Página %{number} de %{count} login: accept_invitation: body: "Has sido invitado a formar parte de %{foodcoop} como miembro del grupo %{group}.
Si quieres participar, es necesario que completes este formulario.
Tu información no será compartida con terceros bajo ninguna razón. Puedes decidir qué información personal será visible. 'Todos' hace referencia a todos los miembros de Foodcoop. Sólo los administradores tienen acceso a tu información.
" @@ -1106,7 +1256,7 @@ es: error_invite_invalid: Tu invitación no es válida. error_token_invalid: La sesión ha expirado o no es válida. Prueba de nuevo. reset_password: - notice: Si tu email está ya registrado aquí, recibirás un mensaje con un enlace para + notice: Si tu email está ya registrado aquí, recibirás un mensaje con un enlace para update_password: notice: Tu contraseña ha sido actualizada. Prueba a conectarte ahora. forgot_password: @@ -1118,9 +1268,13 @@ es: submit: Guardar la nueva contraseña title: Nueva contraseña mailer: + dateformat: "%d %b" feedback: header: "%{user} escribió %{date}:" + subject: Comentarios para Foodsoft + from_via_foodsoft: "%{name} vía Foodsoft" invite: + subject: Invitación al Foodcoop text: | Hola! @@ -1163,6 +1317,8 @@ es: Queridos miebros de %{ordergroup}, El pedido de "%{order}" ha sido cerrado por %{user} en %{when}. + text1: | + Puede ser posiblemente recogido en %{pickup}. text2: | Los siguientes artículos se han pedido para tu grupo de pedido: text3: |- @@ -1172,6 +1328,18 @@ es: Abrazos %{foodcoop}. + order_received: + subject: 'Envío de pedido registrado: %{name}' + text0: | + Estimado %{ordergroup}, + + el pedido de "%{order}" ha sido recibido. + abundant_articles: Recibido demasiado + scarce_articles: Recibido muy poco + article_details: | + o %{name}: + -- Solicitado: %{ordered} x %{unit} + -- Recibido: %{received} x %{unit} order_result_supplier: subject: Nuevo pedido para %{name} text: | @@ -1186,6 +1354,16 @@ es: %{foodcoop} reset_password: subject: Hay tareas que se deben hacer ya! + text: | + Hola %{user}, + + Has (o alguien más) solicitado una nueva contraseña. + Para elegir una nueva contraseña, siga este enlace: %{link} + Este enlace funciona sólo una vez y expira el %{expires}. + Si no quieres cambiar tu contraseña, simplemente ignora este mensaje. Tu contraseña no ha sido cambiada aún. + + + ¡Saludos, tu equipo de Foodsoft! upcoming_tasks: nextweek: 'Tareas para la semana que viene:' subject: Tareas que hay que hacer ya! @@ -1198,16 +1376,50 @@ es: Saludos de %{foodcoop}. + welcome: + subject: Bienvenido al Foodcoop + text0: | + Estimado %{user}, + + se ha creado una nueva cuenta Foodsoft para ti. + text1: | + Para elegir una nueva contraseña, siga este enlace: %{link} + Este enlace solo funciona una vez y caduca el %{expires}. + Siempre puedes usar "¿Olvidaste la contraseña?" para obtener un nuevo enlace. + + + Saludos de %{foodcoop}. + messages_mailer: + foodsoft_message: + footer: | + Respuesta: %{reply_url} + Ver mensaje en línea: %{msg_url} + Opciones de mensaje: %{profile_url} + footer_group: | + Enviado al grupo: %{group} model: delivery: each_stock_article_must_be_unique: Los artículos de stock no pueden ser listados más de una vez. + financial_transaction: + foodcoop_name: Foodcoop + financial_transaction_type: + no_delete_last: Debe existir al menos un tipo de transacción financiera. + group_order: + stock_ordergroup_name: Existencias (%{user}) + invoice: + invalid_mime: tiene un tipo de MIME inválido (%{mime}) membership: no_admin_delete: No te puedes salir de este grupo porque eres el último adimistrador/a. + order_article: + error_price: debe especificarse y tener un precio actual user: no_ordergroup: no hay célula + group_order_article: + order_closed: El pedido está cerrado y no se puede modificar navigation: admin: config: Configuración + finance: Finanzas home: Resumen mail_delivery_status: Problemas de email ordergroups: Grupos de pedido @@ -1216,12 +1428,14 @@ es: workgroups: grupos de trabajo articles: categories: Categorías + stock: Existencias suppliers: Proveedores/artículos title: Artículos dashboard: Escritorio finances: accounts: Administrar cuentas balancing: Pedidos de cuenta + bank_accounts: Cuentas bancarias home: Resumen invoices: Facturas title: Finanzas @@ -1232,6 +1446,7 @@ es: archive: Mis Pedidos manage: Gestionar pedidos ordering: Hacer pedido! + pickups: Días de recogida title: Pedidos tasks: Tareas workgroups: Grupos de trabajo @@ -1262,9 +1477,6 @@ es: units_ordered: Unidades pedidas create: 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: title: 'Edita pedido: %{name}' edit_amount: @@ -1272,6 +1484,7 @@ es: field_unlocked_title: La distribución de este artículo entre los grupos de pedido se ha cambiado a mano. Cuando cambies las cantidades, esos cambios manuales se perderán. edit_amounts: no_articles_available: Ningún artículo para añadir. + set_all_to_zero: Poner todo a cero fax: amount: Cantidad articles: Artículos @@ -1305,7 +1518,9 @@ es: error_closed: El pedido ya estaba cerrado error_nosel: Debes seleccionar al menos un artículo. Quizás quieres borrar el pedido? error_starts_before_boxfill: tiene que ser después de la fecha de comienzo (o estar vacío) + error_starts_before_ends: debe ser después de la fecha de inicio (o permanecer vacío) notice_close: 'Pedido: %{name}, hasta %{ends}' + stock: Existencias warning_ordered: 'Cuidado: los artículos marcados en rojo ya han sido pedidos en este pedido abierto. Si los deseleccionas aquí, todos los pedidos actuales de estos artículos se borrarán. Para proceder, confirma abajo.' warning_ordered_stock: 'Cuidado: Los artículos marcados en rojo ya han sido pedidos en este pedido de stock. Si los deseleccionas aquí, todos los pedidos y compras de estos artículos se borrarán y no estarán en la contabilidad. Para proceder, confirma abajo.' new: @@ -1315,6 +1530,8 @@ es: consider_member_tolerance: considera la tolerancia notice: 'Pedido recibido: %{msg}' notice_none: Ningún nuevo artículo para recibir + paragraph: Si el pedido y el importe recibido son los mismos, los campos correspondientes pueden estar vacíos. Sigue siendo buena práctica entrar en todos los campos, ya que esto proporciona una forma fácil de verificar que todos los artículos han sido seleccionados. + rest_to_stock: restablecer a valores en existencias submit: recibe pedido surplus_options: 'Opciones de distribución:' title: Recibiendo %{order} @@ -1328,8 +1545,15 @@ es: comments: title: Comentarios comments_link: Comentarios + confirm_delete: '¿Estás seguro/a de que quieres borrar el pedido?' + confirm_end: |- + ¿Realmente desea cerrar el pedido %{order}? + No hay vuelta atrás. + confirm_send_to_supplier: El pedido ya ha sido enviado al proveedor el %{when}. ¿Realmente desea enviarlo de nuevo? create_invoice: Añade factura + description1_order: "%{state} pedido de %{supplier} abierto por %{who}" description1_period: + pickup: y puede ser recogido en %{pickup} starts: abierto desde %{starts} starts_ends: abierto desde %{starts} hasta %{ends} description2: "%{ordergroups} ha pedido %{article_count} artículos, con un valor total de %{net_sum} / %{gross_sum} (neto / bruto)." @@ -1355,14 +1579,30 @@ es: notice: Se actualizó el pedido. update_order_amounts: msg1: "%{count} artículos (%{units} units) actualizados" + msg2: "%{count} (%{units}) usando tolerancia" + msg4: "%{count} (%{units}) sobra" + pickups: + document: + empty_selection: Debe seleccionar al menos un pedido. + filename: Recogida para %{date} + invalid_document: Tipo de documento inválido + title: Recogida para %{date} + index: + article_pdf: Artículo PDF + group_pdf: Grupo PDF + matrix_pdf: Matrix PDF + title: Días de recogida sessions: logged_in: '¡Te has conectado!' + logged_out: '¡Te has desconectado!' login_invalid_email: Dirección de email o contraseña no válidas login_invalid_nick: Usuario o contraseña no válidos new: forgot_password: '¿Has olvidado la contraseña?' login: Entra nojs: Atención, las cookies y el javascript deben ser activados! Por favor desactiva %{link}. + noscript: NoScript + title: Inicio de sesión Foodsoft shared: articles: ordered: Pedidos @@ -1391,6 +1631,11 @@ es: order_download_button: article_pdf: Artículos PDF download_file: Descargar archivo + fax_csv: Fax CSV + fax_pdf: Fax PDF + fax_txt: Texto fax + group_pdf: Grupo PDF + matrix_pdf: Matrix PDF title: Descargar task_list: accept_task: Acepta la tarea @@ -1406,9 +1651,13 @@ es: workgroup_members: title: Membresías de grupo simple_form: + error_notification: + default_message: Se han encontrado errores. Por favor, compruebe el formulario. hints: article: unit: por ej. KG o 1L o 500g + article_category: + description: lista separada por comas de nombres de categorías reconocidos en la importación/sincronización order_article: units_to_order: Si cambias la cantidad total de unidades enviadas también tendrás que cambiar los valores individuales de grupo haciendo click en el nombre del artículo. No serán recalculados automáticamente, así que a los otros grupos de pedido se les podrían ser cobrar artículos que no llegarán! update_global_price: Actualizar el precio para futuros pedidos @@ -1428,6 +1677,7 @@ es: notify: negative_balance: Infórmame cuando mi grupo de pedido tenga un balance negativo. order_finished: Infórmame acerca del resultado de mi pedido (cuando se cierre). + order_received: Infórmame sobre los datos de entrega (después de recibir el pedido). upcoming_tasks: Recordarme las tareas incompletas. profile: email_is_public: El email es visible para otros miembros @@ -1437,6 +1687,7 @@ es: settings_group: messages: Mensajes privacy: Privacidad + 'no': 'No' options: settings: profile: @@ -1446,7 +1697,9 @@ es: es: Español fr: Francés nl: Neerlandés + tr: Turco required: + mark: "*" text: requerido 'yes': 'Sí' stock_takings: @@ -1460,22 +1713,34 @@ es: new: amount: Cantidad create: crea + stock_articles: Artículos en existencias + temp_inventory: inventario temporal + text_deviations: Por favor, rellene todas las desviaciones excedentes del %{inv_link}. Para la reducción, utilice un número negativo. + text_need_articles: Tienes que %{create_link} un nuevo artículo de existencias antes de poder usarlo aquí. + title: Crear nuevo inventario show: amount: Cantidad article: Artículo + confirm_delete: '¿Realmente deseas eliminar el inventario?' date: Fecha note: Nota overview: Inventario supplier: Proveedor title: Muestra inventario unit: Unidad + stock_takings: + confirm_delete: '¿Estás seguro que quieres borrar esto?' + date: Fecha + note: Nota + update: + notice: Inventario actualizado. stockit: check: not_empty: "%{name} no se pudo borrar, el inventario no es cero." copy: title: Copia artículo de stock create: - notice: Se ha creado el nuevo producto en stock "%{name}" + notice: Se ha creado el nuevo producto en stock "%{name}" derive: title: Añade un artículo en stock desde plantilla destroy: @@ -1494,6 +1759,7 @@ es: show_stock_takings: Resumen del inventario stock_count: 'Número de artículos' stock_worth: 'Valor actual del stock:' + title: Existencias (%{article_count}) toggle_unavailable: Muestra/esconde los artículos no disponibles view_options: Ver opciones new: @@ -1501,6 +1767,7 @@ es: title: Añade mi nuevo artículo de stock show: change_quantity: Cambia + datetime: Hora new_quantity: Nueva cantidad reason: Razón stock_changes: Cambio de cantidades en stock @@ -1518,6 +1785,7 @@ es: action_new: Crea un nuevo proveedor/a articles: artículos (%{count}) confirm_del: Estas seguro de que quieres borrar al proveedor %{name}? + deliveries: entregas (%{count}) stock: en stock (%{count}) title: Proveedores new: @@ -1583,9 +1851,10 @@ es: accept_task: Aceptar tarea confirm_delete_group: Estás seguro/a de que quieres borrar esta tarea y todas las tareas subsecuentes? confirm_delete_single: Estás seguro/a de que quieres borrar esta tarea? - confirm_delete_single_from_group: Estás seguro/a de que quieres borrar esta tarea (y mantener las tareas recurrentes relacionadas)? + confirm_delete_single_from_group: Estás seguro/a de que quieres borrar esta tarea (y mantener las tareas recurrentes relacionadas)? delete_group: Borrar esta tarea y las subsecuentes edit_group: Edita recurrencia + hours: "%{count}h" mark_done: Marca tarea como hecha reject_task: Rechaza tarea title: Muestra tarea @@ -1606,20 +1875,38 @@ es: back: Volver cancel: Cancelar close: Cerrar + confirm_delete: '¿Realmente desea eliminar %{name}?' + confirm_restore: '¿Realmente desea restaurar %{name}?' copy: Copia delete: Eliminar download: Descarga edit: Editar + marks: + close: "×" + success: + move: Mover or_cancel: o cancelar please_wait: Espera... restore: Restaura save: Guardar search_placeholder: Busca ... show: Mostrar + views: + pagination: + first: "«" + last: "»" + next: "›" + previous: "‹" + truncate: "..." workgroups: edit: title: Edita grupo de trabajo + error_last_admin_group: El último grupo con derechos de administrador no debe ser eliminado + error_last_admin_role: El rol de administrador del último grupo con derechos de administrador no puede ser retirado index: title: Grupos de trabajo update: notice: El grupo de trabajo se actualizó. + time: + formats: + foodsoft_datetime: "%d/%b/%Y %H:%M" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 04dc03fc..b21a8d24 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -14,7 +14,7 @@ fr: gross_price: Prix TTC manufacturer: Product-rice-eur name: Nom - order_number: Numéro + order_number: Numéro order_number_short: Numéro origin: Lieu de production price: Prix HT @@ -347,7 +347,7 @@ fr: already_imported: déjà importé not_found: Aucun produit correspondant n'a été trouvé index: - change_supplier: Changer de fournisseur-e... + change_supplier: Changer de fournisseur-e edit_all: Tout modifier ext_db: import: Rechercher/Importer @@ -417,6 +417,7 @@ fr: street: Rue zip_code: Code postal currency_unit: Monnaie + disable_members_overview: Désactiver la liste des membres name: Nom distribution_strategy: Stratégie de distribution distribution_strategy_options: @@ -678,7 +679,6 @@ fr: action_save: Enregistrer ta commande new_funds: Nouveau solde price: Prix - price_per_base_unit: Prix de base reset_article_search: Réinitialiser la recherche search_article: Rechercher des produits... sum_amount: Quantité déjà commandée @@ -831,6 +831,8 @@ fr: js: ordering: confirm_change: Les changements apportés à cette commande vont être perdus. Est-ce que tu veux vraiment continuer? + trix_editor: + file_size_alert: Le fichier joint est trop volumineux ! La taille maximale est de 512Mb layouts: email: footer_3_homepage: 'Boufcoop: %{url}' @@ -862,7 +864,7 @@ fr: error_invite_invalid: Ton invitation n'est pas ou plus valide. error_token_invalid: Ton jeton de connexion n'est pas ou plus valide, essaie de cliquer à nouveau sur le lien. reset_password: - notice: Tu vas maintenant recevoir un message contenant un lien qui te permettra de réinitialiser ton mot de passe. + notice: Tu vas maintenant recevoir un message contenant un lien qui te permettra de réinitialiser ton mot de passe. update_password: notice: Ton mot de passe a été mis à jour. Tu peux maintenant de connecter. forgot_password: @@ -1012,9 +1014,6 @@ fr: units_ordered: Unités commandées create: 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: title: 'Modifier la commande: %{name}' edit_amount: @@ -1098,7 +1097,7 @@ fr: closed: décomptée finished: clôturée open: en cours - received: reçu + received: reçu update: notice: La commande a été mise à jour. update_order_amounts: @@ -1201,6 +1200,7 @@ fr: es: Espagnol fr: Français nl: Néerlandais + tr: Turc required: text: requis 'yes': 'Oui' @@ -1349,7 +1349,7 @@ fr: notice: La description du boulot a été mise à jour. notice_converted: Le boulot a été converti en boulot ordinaire (sans répétition). user: - more: Tu t'ennuies en ce moment? Il y aura sûrement du boulot pour toi %{tasks_link}. + more: Tu t'ennuies en ce moment? Il y aura sûrement du boulot pour toi %{tasks_link}. tasks_link: par là-bas title: Ton boulot title_accepted: Boulots acceptés @@ -1374,8 +1374,11 @@ fr: edit: title: Modifier l'équipe error_last_admin_group: Impossible de supprimer la dernière cellule avec privilèges administratrices. - error_last_admin_role: Les privilèges administratrices ne peuvent pas être retirés à la dernière cellule qui les possède. + error_last_admin_role: Les privilèges administratrices ne peuvent pas être retirés à la dernière cellule qui les possède. index: title: Équipes update: notice: L'équipe a été mise à jour + time: + formats: + foodsoft_datetime: "%d/%m/%Y %H:%M" diff --git a/config/locales/nl.yml b/config/locales/nl.yml index dd41b666..8597d2b7 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -6,19 +6,19 @@ nl: availability: Artikel leverbaar? availability_short: leverb. deposit: Statiegeld - fc_price: Foodcoop prijs - fc_price_desc: Prijs inclusief belasting, statiegeld en foodcoop marge. - fc_price_short: FC prijs - fc_share: Foodcoop marge - fc_share_short: FC marge - gross_price: Bruto prijs + fc_price: Foodcoop-prijs + fc_price_desc: Prijs inclusief belasting, statiegeld en foodcoop-marge. + fc_price_short: FC-prijs + fc_share: Foodcoop-marge + fc_share_short: FC-marge + gross_price: Brutoprijs manufacturer: Producent name: Naam note: Notitie order_number: Artikelnummer order_number_short: Nr. origin: Herkomst - price: Netto prijs + price: Nettoprijs supplier: Leverancier tax: BTW unit: Eenheid @@ -26,22 +26,28 @@ nl: unit_quantity_short: Colli units: Eenheden article_category: - description: Import namen + description: Namen importeren name: Naam article_price: deposit: Statiegeld - price: Netto prijs + price: Nettoprijs tax: BTW unit_quantity: Colligrootte bank_account: balance: Tegoed + bank_gateway: Bank gateway description: Omschrijving iban: IBAN name: Naam + bank_gateway: + authorization: Autorisatiekoptekst + name: Naam + unattended_user: Gebruiker zonder toezicht + url: URL bank_transaction: amount: Bedrag date: Datum - external_id: Extern ID + external_id: Externe ID financial_link: Financiële link iban: IBAN reference: Referentie @@ -51,26 +57,27 @@ nl: note: Notitie supplier: Leverancier document: - created_at: Upload op - created_by: Upload door - data: Data + created_at: Aangemaakt op + created_by: Aangemaakt door + data: Gegevens mime: MIME-type name: Naam financial_transaction: amount: Bedrag created_on: Datum - financial_transaction_class: Financiële transactie klasse - financial_transaction_type: Financiële transactie type + financial_transaction_class: Financiële-transactieklasse + financial_transaction_type: Financiële-transactietype note: Notitie ordergroup: Huishouden - user: Ingevuld door + user: Ingevoerd door financial_transaction_class: + ignore_for_account_balance: Negeren voor rekeningsaldo name: Naam financial_transaction_type: bank_account: Bankrekening name: Naam - financial_transaction_class: Financiële transactie klasse - name_short: Verkorte naam + financial_transaction_class: Klasse financiële transactie + name_short: Korte naam group_order: ordergroup: Huishouden price: Totaal bestelling @@ -81,16 +88,16 @@ nl: received: Ontvangen result: Hoeveelheid tolerance: Tolerantie - total_price: Som + total_price: Totaal unit_price: Prijs/Eenheid invoice: amount: Bedrag attachment: Bijlage - created_at: Gemaakt op - created_by: Gemaakt door + created_at: Aangemaakt op + created_by: Aangemaakt door date: Factuurdatum - delete_attachment: Verwijder bijlage - deliveries: Voorraad levering + delete_attachment: Bijlage verwijderen + deliveries: Voorraadlevering deposit: Statiegeld in rekening gebracht deposit_credit: Statiegeld teruggekregen financial_link: Financiële link @@ -102,7 +109,7 @@ nl: supplier: Leverancier mail_delivery_status: created_at: Tijd - email: Email + email: E-mail message: Bericht order: boxfill: Dozen vullen na @@ -111,8 +118,8 @@ nl: end_action: Sluitingsactie end_actions: auto_close: Bestelling sluiten - auto_close_and_send: Sluit de bestelling en verzend het naar de leverancier - auto_close_and_send_min_quantity: Sluit de bestelling en verzend het naar de leverancier als de minimum bestelhoeveelheid gehaald is + auto_close_and_send: De bestelling sluiten en naar de leverancier verzenden + auto_close_and_send_min_quantity: De bestelling sluiten en naar de leverancier verzenden als de minimale bestelhoeveelheid gehaald is no_end_action: Geen automatische actie ends: Sluit op name: Leverancier @@ -124,10 +131,10 @@ nl: transport: Vervoerskosten transport_distribution: Verdeling van vervoerskosten transport_distributions: - articles: Verdeel de kosten over het aantal ontvangen artikelen - ordergroup: Ieder huishouden betaald hetzelfde bedrag - price: Verdeel de kosten over het orderbedrag - skip: Verdeel de kosten niet + articles: De kosten over het aantal ontvangen artikelen verdelen + ordergroup: Ieder huishouden betaalt hetzelfde bedrag + price: De kosten over het orderbedrag verdelen + skip: De kosten niet verdelen updated_by: Laatst aangepast door order_article: article: Artikel @@ -141,7 +148,7 @@ nl: units_to_order_short: Besteld update_global_price: Huidige prijs overal bijwerken order_comment: - text: Commentaar voor deze bestelling toevoegen ... + text: Commentaar voor deze bestelling toevoegen… ordergroup: account_balance: Tegoed available_funds: Beschikbaar tegoed @@ -151,10 +158,10 @@ nl: contact_address: Adres contact_person: Contactpersoon contact_phone: Telefoon - description: Omschrijving + description: Beschrijving ignore_apple_restriction: Bestelstop vanwege appelpunten negeren last_order: Laatste bestelling - last_user_activity: Laatst actief + last_user_activity: Laatste activiteit name: Naam user_tokens: Leden stock_article: @@ -173,7 +180,7 @@ nl: customer_number: Klantnummer customer_number_short: Klantnr. delivery_days: Bezorgdagen - email: Email + email: E-mail fax: Fax iban: IBAN is_subscribed: geabonneerd? @@ -186,9 +193,14 @@ nl: phone2: Telefoon 2 shared_sync_method: Hoe synchroniseren url: Homepage + supplier_category: + name: Naam + description: Beschrijving + financial_transaction_class: Financiële-transactieklasse + bank_account: Bankrekening task: - created_by: Gemaakt door - created_on: Gemaakt op + created_by: Aangemaakt door + created_on: Aangemaakt op description: Beschrijving done: Gedaan? due_date: Voor wanneer? @@ -198,11 +210,11 @@ nl: user_list: Verantwoordelijken workgroup: Werkgroep user: - email: Email + email: E-mail first_name: Voornaam iban: IBAN - last_activity: Laatst actief - last_login: Laatste login + last_activity: Laatste activiteit + last_login: Laatste aanmelding last_name: Achternaam name: Naam nick: Gebruikersnaam @@ -214,13 +226,13 @@ nl: one: Werkgroep other: Werkgroepen workgroup: - description: Omschrijving + description: Beschrijving name: Naam role_admin: Beheer role_article_meta: Artikelen role_finance: Financiën role_invoices: Facturen - role_orders: Bestellingen + role_orders: Beheer bestellingen role_pickups: Ophaaldagen role_suppliers: Leveranciers user_tokens: Leden @@ -243,21 +255,24 @@ nl: models: article: Artikel article_category: Categorie + bank_account: Bankrekening + bank_gateway: Betalingsdienst bank_transaction: Banktransactie delivery: Levering financial_transaction: Financiële transactie - financial_transaction_class: Financiële transactie klasse - financial_transaction_type: Financiële transactie type + financial_transaction_class: Klasse financiële transactie + financial_transaction_type: Type financiële transactie invoice: Factuur order: Bestelling - order_article: Bestellingsartikel + order_article: Bestelartikel order_comment: Commentaar ordergroup: one: Huishouden - other: Huishouden + other: Huishoudens stock_article: Voorraadartikel stock_taking: Inventaris supplier: Leverancier + supplier_category: Leverancierscategorie task: Taak user: Gebruiker workgroup: Werkgroep @@ -268,36 +283,44 @@ nl: all_ordergroups: Alle huishoudens all_users: Alle gebruikers all_workgroups: Alle werkgroepen - created_at: gemaakt op - first_paragraph: Hier kun je de groepen en gebruiker van Foodsoft beheren. - groupname: Groepnaam + created_at: aangemaakt op + first_paragraph: Hier kun je de groepen en gebruikers van Foodsoft beheren. + groupname: Groepsnaam members: leden name: naam new_ordergroup: Nieuw huishouden new_user: Nieuwe gebruiker new_workgroup: Nieuwe werkgroep - newest_groups: Nieuwste groepen - newest_users: Nieuwste gebruikers - title: Administratie - type: Type - username: Gebruikersnaam + newest_groups: nieuwste groepen + newest_users: nieuwste gebruikers + title: Beheer + type: type + username: gebruikersnaam + bank_accounts: + form: + title_edit: Bankrekening bewerken + title_new: Nieuwe bankrekening toevoegen + bank_gateways: + form: + title_edit: Betalingsdienst bewerken + title_new: Nieuwe betalingsdienst toevoegen configs: list: key: Sleutel title: Configuratielijst - value: Inhoud + value: Waarde show: submit: Opslaan title: Configuratie tab_layout: - pdf_title: PDF documenten + pdf_title: PDF-documenten tab_messages: - emails_title: Emailinstellingen + emails_title: E-mailinstellingen tab_payment: schedule_title: Bestelrooster tab_security: default_roles_title: Toegang tot - default_roles_paragraph: Ieder lid van de foodcoop heeft standaard toegang tot de volgende onderdelen. + default_roles_paragraph: 'Ieder lid van de foodcoop heeft standaard toegang tot de volgende onderdelen:' tab_tasks: periodic_title: Periodieke taken tabs: @@ -308,29 +331,32 @@ nl: finances: index: bank_accounts: Bankrekeningen - first_paragraph: Hier kunt u de financiële transactieklassen en de bijbehorende financiële transactietypes beheren. Elke financiële transactie heeft een type, die je bij elke transactie moet selecteren, als je meer dan één type hebt gemaakt. De financiële transactieklassen kunnen worden gebruikt om de financiële transactietypes te groeperen en zullen worden weergegeven als extra kolommen in het rekeningoverzicht, als er meer dan één is gecreëerd. + first_paragraph: Hier kunt u de klassen van financiële transacties en de bijbehorende typen financiële transacties beheren. Elke financiële transactie heeft een type, die je bij elke transactie moet selecteren, als je meer dan één type hebt gemaakt. De klassen financiële transacties kunnen worden gebruikt om de types financiële transacties te groeperen en zullen worden weergegeven als extra kolommen in het rekeningoverzicht, als er meer dan één is gecreëerd. new_bank_account: Nieuwe bankrekening toevoegen - new_financial_transaction_class: Nieuwe financiële transactie klasse toevoegen + new_financial_transaction_class: Nieuwe klasse voor financiële transacties toevoegen + new_bank_gateway: Nieuwe betalingsdienst toevoegen title: Financiën - transaction_types: Financiële transactie typen + transaction_types: Typen financiële transacties + supplier_categories: Leverancierscategorieën + new_supplier_category: Nieuwe leverancierscategorie transaction_types: name: Naam - new_financial_transaction_type: Nieuw financiëel transactie type toevoegen + new_financial_transaction_type: Nieuw type financiële transactie toevoegen financial_transaction_classes: form: - title_edit: Financiële transactie klasse bewerken - title_new: Nieuw financiëel transactie type toevoegen + title_edit: Klasse voor financiële transactie bewerken + title_new: Nieuw type financiële transactie toevoegen financial_transaction_types: form: - name_short_desc: De korte naam is verplicht voor financiële transactietypes die automatisch moeten kunnen worden toegewezen bij banktransacties. Als er meerdere bankrekeningen zijn, kan de voorkeursrekening voor bankoverschrijvingen worden geselecteerd. - title_edit: Financiëel transactie type bewerken - title_new: Nieuw financiëel transactie type toevoegen + name_short_desc: De korte naam is verplicht voor typen financiële transacties die automatisch moeten kunnen worden toegewezen bij banktransacties. Als er meerdere bankrekeningen zijn, kan de voorkeursrekening voor bankoverschrijvingen worden geselecteerd. + title_edit: Type financiële transactie bewerken + title_new: Nieuw type financiëel transactie toevoegen mail_delivery_status: destroy_all: - notice: Alle emailproblemen zijn verwijderd + notice: Alle e-mailproblemen zijn verwijderd index: - destroy_all: Alle emailproblemen verwijderen - title: Emailproblemen + destroy_all: Alle e-mailproblemen verwijderen + title: E-mailproblemen ordergroups: destroy: error: 'Huishouden kon niet als verwijderd gemarkeerd worden: %{error}' @@ -342,9 +368,9 @@ nl: here: hier index: first_paragraph: Hier kun je %{url} toevoegen, bewerken en verwijderen. - new_ordergroup: Nieuw huishouden + new_ordergroup: een nieuw huishouden new_ordergroups: nieuwe huishoudens - second_paragraph: 'Bedenk het onderscheid tussen werkgroep en huishouden: een huishouden heeft een rekening en kan bestellen. in een %{url} (bijv. sorteergroep) werken leden samen om taken te vervullen. Leden kunnen slechts lid zijn van éen huishouden, maar van meerdere werkgroepen.' + second_paragraph: 'Let op het onderscheid tussen werkgroep en huishouden: een huishouden heeft een rekening en kan bestellen; in een %{url} (bijv. sorteergroep) werken leden samen om taken te vervullen. Leden kunnen slechts lid zijn van één huishouden, maar van meerdere werkgroepen.' title: Huishoudens workgroup: werkgroep new: @@ -353,39 +379,39 @@ nl: confirm: Weet je het zeker? edit: Groep/leden bewerken title: Huishouden %{name} - search_placeholder: naam ... + search_placeholder: naam… users: controller: - sudo_done: Je bent nu ingelogd als %{user}. Wees voorzichtig, en vergeet niet uit te loggen als je klaar bent! + sudo_done: Je bent nu aangemeld als %{user}. Wees voorzichtig, en vergeet niet af te melden als je klaar bent! destroy: error: 'Gebruiker kon niet verwijderd worden: %{error}' notice: Gebruiker is verwijderd edit: title: Lid bewerken form: - create_ordergroup: Maak een huishouden met dezelfde naam en voeg een gebruiker toe. - send_welcome_mail: Verstuur een welkomstmail naar de gebruiker. + create_ordergroup: Een huishouden met dezelfde naam aanmaken en een gebruiker toevoegen. + send_welcome_mail: Een welkomstmail naar de gebruiker versturen. index: first_paragraph: Hier kun je gebruikers %{url}, bewerken en wissen. new_user: Nieuwe gebruiker new_users: toevoegen show_deleted: Verwijderde gebruikers tonen - title: Gebruikers admin + title: Gebruikersbeheer new: title: Nieuwe gebruiker toevoegen restore: error: 'Gebruiker kon niet opnieuw actief gemaakt worden: %{error}' notice: Gebruiker is opnieuw actief show: - confirm_sudo: Als je doorgaat, neem je de identiteit aan van gebruiker %{user}. Vergeet hierna niet uit te loggen! + confirm_sudo: Als je doorgaat, neem je de identiteit aan van gebruiker %{user}. Vergeet hierna niet af te melden! groupabos: Groepslidmaatschappen member_since: Lid sinds %{time} person: Persoon preference: Voorkeuren - show_email_problems: Bekijk emailproblemen - sudo: Inloggen als + show_email_problems: E-mailproblemen bekijken + sudo: Aanmelden als users: - show_email_problems: Bekijk emailproblemen + show_email_problems: E-mailproblemen bekijken workgroups: destroy: error: 'Werkgroep kon niet verwijderd worden: %{error}' @@ -400,7 +426,7 @@ nl: new_workgroup: Nieuwe werkgroep new_workgroups: nieuwe werkgroepen ordergroup: huishouden - second_paragraph: 'Let op het verschil tussen een groep en een huishouden: een %{url} heeft een tegoed en kan bestellen. In een werkgroep (bijv. ''sorteergroep'') organizeren zich de leden met behulp van taken en berichten. Gebruikers kunnen slechts lid zijn van één huishouden, maar van meerdere werkgroepen.' + second_paragraph: 'Let op het verschil tussen een groep en een huishouden: een %{url} heeft een tegoed en kan bestellen. In een werkgroep (bijv. ''sorteergroep'') organiseren zich de leden met behulp van taken en berichten. Gebruikers kunnen slechts lid zijn van één huishouden, maar van meerdere werkgroepen.' title: Werkgroepen new: title: Werkgroep toevoegen @@ -411,11 +437,15 @@ nl: workgroups: members: leden name: naam + supplier_categories: + form: + title_new: Leverancierscategorie toevoegen + title_edit: Leverancierscategorie bewerken application: controller: - error_authn: Inloggen vereist! - error_denied: Je hebt geen toegang tot de gevraagde pagina. Als je denkt dat je dat wel zou moeten hebben, vraag dan een beheerder je die rechten te geven. Als je meerdere accounts hebt, wil je mogelijk %{sign_in}. - error_denied_sign_in: inloggen als een andere gebruiker + error_authn: Aanmelden vereist! + error_denied: Je hebt geen toegang tot de gevraagde pagina. Als je denkt dat je dat wel zou moeten hebben, vraag dan een beheerder je die rechten te geven. Als je meerdere accounts hebt, wil je je mogelijk %{sign_in}. + error_denied_sign_in: aanmelden als een andere gebruiker error_feature_disabled: Deze optie is momenteel niet actief. error_members_only: Deze actie is alleen beschikbaar voor leden van de groep! error_minimum_balance: Sorry, je tegoed is lager dan het minimum van %{min}. @@ -429,7 +459,7 @@ nl: title: Categorie bewerken index: new: Nieuwe categorie - title: Categoriën + title: Categorieën new: title: Nieuwe categorie maken update: @@ -440,9 +470,9 @@ nl: articles: confirm_delete: Weet je zeker dat je alle artikelen wilt verwijderen? option_available: Artikelen beschikbaar maken - option_delete: Verwijder artikel + option_delete: Artikel verwijderen option_not_available: Artikelen onbeschikbaar maken - option_select: Kies actie ... + option_select: Actie kiezen… price_netto: Prijs unit_quantity_desc: Aantal eenheden per doos (colli) unit_quantity_short: Colli @@ -451,10 +481,10 @@ nl: notice: "Er zijn %{count} nieuwe artikelen opgeslagen." error_invalid: Er zijn artikelen die een fout hebben error_nosel: Geen artikelen geselecteerd - error_parse: "%{msg} ... in regel %{line}" + error_parse: "%{msg} … in regel %{line}" error_update: 'Er trad een fout op bij het bijwerken van artikel ''%{article}'': %{msg}' parse_upload: - no_file: Kies een bestand om te uploaden. + no_file: Een bestand om te uploaden kiezen. notice: "%{count} artikelen zijn geanalyseerd" sync: notice: Catalogus is bijgewerkt @@ -472,7 +502,7 @@ nl: drop: verwijderen note: "%{article} is deel van een lopende bestelling en kan niet verwijderd worden. Het artikel graag eerst uit de bestelling(en) %{drop_link}." edit_all: - note: 'Verplichte velden zijn: Naam, eenheid, (netto) prijs en bestellingsnummer.' + note: 'Verplichte velden zijn: Naam, eenheid, (netto) prijs en bestelnummer.' submit: Alle artikelen bijwerken title: Alle artikelen van %{supplier} bewerken warning: 'Let op, alle artikelen worden bijgewerkt!' @@ -484,7 +514,7 @@ nl: already_imported: geïmporteerd not_found: Geen artikelen gevonden index: - change_supplier: Leverancier wisselen ... + change_supplier: Leverancier wisselen download: Artikelen downloaden edit_all: Alles bewerken ext_db: @@ -497,14 +527,14 @@ nl: title: Artikel importeren new: Nieuw artikel new_order: Nieuwe bestelling - search_placeholder: Naam ... + search_placeholder: Naam… title: Artikelen van %{supplier} (%{count}) upload: Artikelen uploaden model: error_in_use: "%{article} kan niet gewist worden, want deze is deel van een lopende bestelling!" error_nosel: Je hebt geen artikelen geselecteerd parse_upload: - body: "Ingelezen artikelen graag controleren.
Let op, momenteel vind er geen controle op dubbele artikelen plaats.
" + body: "Ingelezen artikelen graag controleren.
Let op, momenteel vindt er geen controle op dubbele artikelen plaats.
" submit: Upload verwerken title: Artikelen uploaden sync: @@ -512,34 +542,33 @@ nl: alert_used: Opgelet, %{article} wordt gebruikt in een lopende bestelling. Haal het eerst uit de bestelling. body: 'De volgende artikelen zijn uit de lijst gehaald en worden verwijderd:' body_ignored: - one: Er is één artikel zonder artikelnummer overslagen. + one: Er is één artikel zonder artikelnummer overgeslagen. other: "%{count} artikelen zonder artikelnummer zijn overgeslagen." body_skip: Er zijn geen artikelen om te verwijderen. - title: Uit de lijst halen ... + title: Uit de lijst halen… price_short: prijs submit: Alles synchroniseren title: Artikelen met externe database synchroniseren unit_quantity_short: Colli update: body: 'Ieder artikel wordt tweemaal getoond: oude waarden zijn grijs, en de tekstvelden bevatten de nieuwe waarden. Verschillen met de oude artikelen zijn geel gemarkeerd.' - title: Bijwerken ... + title: Bijwerken… update_msg: - one: Er moet éen artikel bijgewerkt worden. + one: Er moet één artikel bijgewerkt worden. other: "Er moeten %{count} artikelen bijgewerkt worden." upnew: body_count: - one: Er is éen nieuw artikel. + one: Er is één nieuw artikel. other: Er zijn %{count} nieuwe artikelen. - title: Toevoegen ... + title: Toevoegen… upload: fields: reserved: "(Leeg)" status: Status (x=overslaan) - file_label: Graag een compatibel bestand uitkiezen + file_label: Kies een compatibel bestand uit options: - convert_units: Bestaande eenheden behouden, herbereken groothandelseenheid en prijs (net als synchronizeren). + convert_units: Bestaande eenheden behouden, groothandelseenheid en prijs herberekenen (net als synchroniseren). outlist_absent: Artikelen die niet in het bestand voorkomen, verwijderen. - upload_category: Categorieën overnemen uit bestand. sample: juices: Sappen nuts: Noten @@ -550,28 +579,28 @@ nl: tomato_juice: Tomatensap walnuts: Walnoten submit: Bestand uploaden - text_1: 'Hier kun je een spreadsheet uploaden om de artikelen van %{supplier} bij te werken. Zowel Excel (xls, xlsx) als OpenOffice (ods) spreadsheets worden gelezen, evenals csv-bestanden (kolommen geschieden door ";", utf-8 encoding). Alleen de eerste sheet wordt geïmporteerd, en kolommen worden verwacht in deze volgorde:' - text_2: De rijen hier getoond zijn voorbeelden. Een "x" in de eerste kolom geeft aan dat het artikel niet meer beschikbaar is en zal worden verwijderd. Hiermee kun je snel meerdere artikelen tegelijk verwijderen. De categorie wordt gematched met de Foodsoft categorielijst (zowel met de categorienaam als de bijbehorende importnamen). + text_1: 'Hier kun je een spreadsheet uploaden om de artikelen van %{supplier} bij te werken. Spreadsheets van zowel Excel (xls, xlsx) als OpenOffice (ods) worden gelezen, evenals csv-bestanden (kolommen gescheiden door ";", utf-8 encoding). Alleen de eerste sheet wordt geïmporteerd, en kolommen worden verwacht in deze volgorde:' + text_2: De rijen hier getoond zijn voorbeelden. Een “x” in de eerste kolom geeft aan dat het artikel niet meer beschikbaar is en zal worden verwijderd. Hiermee kun je snel meerdere artikelen tegelijk verwijderen. De categorie wordt vergeleken met de categorielijst van Foodsoft (zowel met de categorienaam als de bijbehorende importnamen). title: Artikelen uploaden voor %{supplier} bank_account_connector: - confirm: Bevestig de code %{code}. + confirm: Code %{code} bevestigen. fields: - email: E-Mail + email: E-mail pin: PIN password: Wachtwoord tan: TAN username: Gebruikersnaam config: hints: - applepear_url: Website waar het appelpunten systeem wordt uitgelegd. - charge_members_manually: Kies deze optie als je elders bijhoudt wie welke producten heeft gekregen (bijvoorbeeld op papier), en dat ook niet naderhand in Foodsoft invoert. Na het afrekenen van bestellingen moet je dan iedere keer bij leden handmatig het in rekening te brengen bedrag afschrijven (gebruik "Nieuwe transacties toevoegen"). Het blijft wel nodig bestellingen af te rekenen, maar dat brengt dan niets in rekening bij leden. + applepear_url: Website waar het appelpuntensysteem wordt uitgelegd. + charge_members_manually: Kies deze optie als je elders bijhoudt wie welke producten heeft gekregen (bijvoorbeeld op papier), en dat ook niet naderhand in Foodsoft invoert. Na het afrekenen van bestellingen moet je dan iedere keer bij leden handmatig het in rekening te brengen bedrag afschrijven (gebruik “Nieuwe transacties toevoegen”). Het blijft wel nodig bestellingen af te rekenen, maar dat brengt dan niets in rekening bij leden. contact: email: Algemeen contactadres, zowel voor op de website als in formulieren. street: Adres, meestal is dit het aflever- en ophaaladres. currency_space: Spatie toevoegen na valutasymbool. currency_unit: Valutasymbool voor het tonen van prijzen. - custom_css: De layout van deze site kan gewijzigd worden door hier cascading stylesheets (CSS) in te voeren. Laat het leeg voor de standaardstijl. - email_from: Emails zullen lijken verzonden te zijn vanaf dit email adres. Laat het veld leeg om het contactadres van de foodcoop te gebruiken. + custom_css: Om de lay-out van deze site aan te passen, kunt u stijlwijzigingen invoeren met behulp van cascading stylesheets (CSS). Laat leeg voor de standaardstijl. + email_from: Het zal lijken alsof e-mails verzonden zijn vanaf dit e-mailadres. Laat het veld leeg om het contactadres van de foodcoop te gebruiken. email_replyto: Vul dit in als je antwoord op mails van Foodsoft wilt ontvangen op een ander adres dan het bovenstaande. email_sender: Emails worden verzonden vanaf dit emailadres. Om te voorkomen dat emails als spam worden tegengehouden, is het te adviseren het adres van de webserver op te nemen in het SPF record van het email domein. help_url: Documentatie website. @@ -626,12 +655,13 @@ nl: default_role_orders: Bestellingen default_role_pickups: Ophaaldagen default_role_suppliers: Leveranciers - disable_invite: Uitnodigingen deactiveren - email_from: From adres - email_replyto: Reply-to adres - email_sender: Sender adres - help_url: Documentatie URL - homepage: Homepage + disable_invite: Uitnodigingen uitschakelen + disable_members_overview: Ledenlijst deactiveren + email_from: Adres afzender + email_replyto: Antwoord-adres + email_sender: Adres afzender + help_url: URL documentatie + homepage: Hoofdpagina ignore_browser_locale: Browsertaal negeren minimum_balance: Minimum tegoed name: Naam @@ -1018,7 +1048,6 @@ nl: error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon de bestelling niet bijgewerkt worden. notice: Bestelling opgeslagen. errors: - balance_alert: Accountsaldo in het rood closed: Deze bestelling is al gesloten. no_member: Je bent geen lid van dit huishouden. notfound: Foute URL, dit is niet jouw bestelling. @@ -1026,12 +1055,10 @@ nl: action_save: Bestelling opslaan new_funds: Nieuw tegoed price: Prijs - price_per_base_unit: Basisprjis reset_article_search: Alles tonen search_article: Artikelen zoeken... sum_amount: Huidig totaalbedrag title: Bestellen - sub_title: Plaats bestelling voor %{order_name} total_sum_amount: Totalbedrag total_tolerance: Totale tolerantie units: Eenheden @@ -1075,6 +1102,7 @@ nl: sum: Som title: Jouw bestelling voor %{order} switch_order: + remaining: "nog %{remaining}" title: Lopende bestellingen update: error_general: Er is een probleem opgetreden, de bestelling kon niet bijgewerkt worden. @@ -1191,6 +1219,8 @@ nl: js: ordering: confirm_change: Als je naar een andere bestelling gaat, gaan je aanpassingen in deze bestelling verloren. Wijzigingen vergeten en naar de andere bestelling gaan? + trix_editor: + file_size_alert: De bestandsbijlage is te groot! De maximale grootte is 512Mb! layouts: email: footer_1_separator: "--" @@ -1310,11 +1340,11 @@ nl: order_result_supplier: subject: Nieuwe bestelling voor %{name} text: | - Beste mijnheer/mevrouw, + Goeiedag, - Foodcoop %{foodcoop} wil graag een bestelling plaatsen. + %{foodcoop} wil graag een bestelling plaatsen. - Een PDF en spreadsheet vind u meegestuurd. + Een PDF en spreadsheet vindt u in bijlage. Met vriendelijke groet, %{user} @@ -1442,9 +1472,6 @@ nl: units_ordered: Bestelde eenheden create: notice: De bestelling is aangemaakt. - custom_csv: - description: Kies de volgorde van de attributen en de attributen voor het csv-bestand - column: kolom edit: title: 'Bestelling aanpassen: %{name}' edit_amount: @@ -1665,6 +1692,7 @@ nl: es: Spaans fr: Frans nl: Nederlands + tr: Turks required: mark: "*" text: verplicht @@ -1874,3 +1902,6 @@ nl: title: Werkgroepen update: notice: Werkgroep is bijgewerkt + time: + formats: + foodsoft_datetime: "%d-%m-%Y %H:%M" diff --git a/config/locales/tr.yml b/config/locales/tr.yml new file mode 100644 index 00000000..bbc325bd --- /dev/null +++ b/config/locales/tr.yml @@ -0,0 +1,1910 @@ +tr: + activerecord: + attributes: + article: + article_category: Kategori + availability: Ürün mevcut mu? + availability_short: mevcut. + deposit: Depozito + fc_price: FoodCoop fiyatı + fc_price_desc: Vergiler, depozito ve Foodcoop ücreti dahil fiyat. + fc_price_short: FC fiyatı + fc_share: FoodCoop marjı + fc_share_short: FC marjı + gross_price: Brüt fiyat + manufacturer: Üretici + name: Adı + note: Not + order_number: Sipariş numarası + order_number_short: Nr. + origin: Menşei + price: Fiyat (net) + supplier: Tedarikçi + tax: KDV + unit: Birim + unit_quantity: Birim miktarı + unit_quantity_short: B.M. + units: Birimler + article_category: + description: İthalat isimleri + name: Adı + article_price: + deposit: Depozito + price: Fiyat (net) + tax: KDV + unit_quantity: Birim miktarı + bank_account: + balance: Bakiye + bank_gateway: Banka geçidi + description: Açıklama + iban: IBAN + name: Adı + bank_gateway: + authorization: Yetkilendirme başlığı + name: Adı + unattended_user: Devre dışı bırakılmış kullanıcı + url: URL + bank_transaction: + amount: Tutar + date: Tarih + external_id: Harici ID + financial_link: Finansal bağlantı + iban: IBAN + reference: Referans + text: Açıklama + delivery: + date: Teslim tarihi + note: Not + supplier: Tedarikçi + document: + created_at: Oluşturulma tarihi + created_by: Oluşturan + data: Veri + mime: MIME tipi + name: Adı + financial_transaction: + amount: Tutar + created_on: Tarih + financial_transaction_class: Finansal işlem sınıfı + financial_transaction_type: Finansal işlem türü + note: Not + ordergroup: Sipariş grubu + user: Giren kullanıcı + financial_transaction_class: + ignore_for_account_balance: Hesap bakiyesi için yoksay + name: Adı + financial_transaction_type: + bank_account: Banka Hesabı + name: Adı + financial_transaction_class: Finansal işlem sınıfı + name_short: Kısa Adı + group_order: + ordergroup: Sipariş grubu + price: Sipariş tutarı + updated_by: Son siparişi veren + group_order_article: + ordered: Sipariş edildi + quantity: Miktar + received: Alındı + result: Sonuç + tolerance: Tolerans + total_price: Toplam + unit_price: Birim fiyatı + invoice: + amount: Tutar + attachment: Ek + created_at: Oluşturulma tarihi + created_by: Oluşturan + date: Fatura tarihi + delete_attachment: Eki sil + deliveries: Stok teslimatı + deposit: Tahsil edilen depozito + deposit_credit: İade edilen depozito + financial_link: Finansal bağlantı + net_amount: İade için düzeltilmiş tutar + note: Not + number: Numara + orders: Sipariş + paid_on: Ödendiği tarih + supplier: Tedarikçi + mail_delivery_status: + created_at: Tarih + email: E-posta + message: Mesaj + order: + boxfill: Kutuları doldurma tarihi + closed_by: Kapatıldı + created_by: Oluşturan + end_action: Otomatik kapanma eylemi + end_actions: + auto_close: Siparişi kapat + auto_close_and_send: Siparişi kapat ve tedarikçiye gönder + auto_close_and_send_min_quantity: Minimum miktarı karşılandığında siparişi kapat ve tedarikçiye gönder + no_end_action: Otomatik eylem yok + ends: Bitiş tarihi + name: Tedarikçi + note: Not + pickup: Teslim alma + starts: Başlangıç tarihi + status: Durum + supplier: Tedarikçi + transport: Taşıma maliyeti + transport_distribution: Taşıma maliyeti dağıtımı + transport_distributions: + articles: Alınan ürün sayısına göre maliyeti dağıt + ordergroup: Her sipariş grubu aynı tutarı öder + price: Sipariş tutarına göre maliyeti dağıt + skip: Maliyeti dağıtma + updated_by: Son düzenleyen + order_article: + article: Ürün + missing_units: Eksik birimler + missing_units_short: Eksik + quantity: Talep edilen miktar + quantity_short: Talep + units_received: Alınan birimler + units_received_short: Alınan + units_to_order: Sipariş edilen birimler + units_to_order_short: Sipariş edildi + update_global_price: Mevcut fiyatı tüm siparişlerde güncelle + order_comment: + text: Bu siparişe yorum ekle ... + ordergroup: + account_balance: Hesap bakiyesi + available_funds: Kredi limiti + break: "(Son) mola" + break_until: kadar + contact: İletişim + contact_address: Adres + contact_person: İlgili kişi + contact_phone: Telefon + description: Açıklama + ignore_apple_restriction: Elma puan sınırlamasını yok say + last_order: Son sipariş + last_user_activity: Son etkinlik + name: Adı + user_tokens: Üyeler + stock_article: + available: Mevcut + price: Fiyat + quantity: Stoktaki miktar + quantity_available: Mevcut miktar + quantity_available_short: Mevcut + quantity_ordered: Sipariş edilen miktar + stock_taking: + date: Tarih + note: Not + supplier: + address: Adres + contact_person: İlgili kişi + customer_number: Müşteri numarası + customer_number_short: Müşteri nr. + delivery_days: Teslimat günleri + email: E-posta + fax: Faks + iban: IBAN + is_subscribed: abone mi? + min_order_quantity: Minimum sipariş miktarı + min_order_quantity_short: Min. miktar + name: Adı + note: Not + order_howto: Nasıl sipariş verilir + phone: Telefon + phone2: Telefon 2 + shared_sync_method: Nasıl senkronize edilir + url: Ana sayfa + supplier_category: + name: Adı + description: Açıklama + financial_transaction_class: Finansal işlem sınıfı + bank_account: Banka hesabı + task: + created_by: Oluşturan + created_on: Oluşturma tarihi + description: Açıklama + done: Yapıldı mı? + due_date: Bitiş tarihi + duration: Süre + name: Aktivite + required_users: Gereken kişi sayısı + user_list: Sorumlu kullanıcılar + workgroup: Çalışma grubu + user: + email: E-posta + first_name: İsim + iban: IBAN + last_activity: Son etkinlik + last_login: Son giriş + last_name: Soyadı + name: Adı + nick: Kullanıcı adı + ordergroup: Sipariş grubu + password: Şifre + password_confirmation: Şifreyi tekrarla + phone: Telefon + workgroup: + one: Çalışma grubu + other: Çalışma grupları + workgroup: + description: Açıklama + name: Adı + role_admin: Yönetim + role_article_meta: Ürün veritabanı + role_finance: Finans + role_invoices: Faturalar + role_orders: Sipariş yönetimi + role_pickups: Teslim günleri + role_suppliers: Tedarikçiler + user_tokens: Üyeler + errors: + has_many_left: Bu %{collection} ile hala ilişkili! + models: + article: + attributes: + name: + taken: isim zaten alınmış + taken_with_unit: isim ve birim zaten alınmış + supplier: + attributes: + shared_sync_method: + included: bu tedarikçi için geçerli bir seçenek değil + task: + attributes: + done: + exclusion: tamamlanmış görevler tekrarlanamaz + models: + article: Ürün + article_category: Kategori + bank_account: Banka hesabı + bank_gateway: Banka geçidi + bank_transaction: Banka işlemi + delivery: Teslimat + financial_transaction: Finansal işlem + financial_transaction_class: Finansal işlem sınıfı + financial_transaction_type: Finansal işlem türü + invoice: Fatura + order: Sipariş + order_article: Sipariş ürünü + order_comment: Sipariş yorumu + ordergroup: + one: Sipariş grubu + other: Sipariş grupları + stock_article: Stok ürünü + stock_taking: Stok sayımı + supplier: Tedarikçi + supplier_category: Tedarikçi kategorisi + task: Görev + user: Kullanıcı + workgroup: Çalışma grubu + admin: + access_to: Erişim sağla + base: + index: + all_ordergroups: Tüm sipariş grupları + all_users: Tüm kullanıcılar + all_workgroups: Tüm çalışma grupları + created_at: oluşturma tarihi + first_paragraph: Burada Foodsoft gruplarını ve kullanıcılarını yönetebilirsiniz. + groupname: grup adı + members: üyeler + name: adı + new_ordergroup: Yeni sipariş grubu + new_user: Yeni kullanıcı + new_workgroup: Yeni çalışma grubu + newest_groups: en yeni gruplar + newest_users: en yeni kullanıcılar + title: Yönetim + type: tür + username: kullanıcı adı + bank_accounts: + form: + title_edit: Banka hesabını düzenle + title_new: Yeni banka hesabı ekle + bank_gateways: + form: + title_edit: Banka geçidini düzenle + title_new: Yeni banka geçidi ekle + configs: + list: + key: Anahtar + title: Konfigürasyon listesi + value: Değer + show: + submit: Kaydet + title: Konfigürasyon + tab_layout: + pdf_title: PDF belgeleri + tab_messages: + emails_title: E-posta gönderimi + tab_payment: + schedule_title: Sipariş takvimi + tab_security: + default_roles_title: Erişim sağlanacak alanlar + default_roles_paragraph: Foodcoop üyesi herkes varsayılan olarak aşağıdaki alanlara erişime sahiptir. + tab_tasks: + periodic_title: Düzenli görevler + tabs: + title: Yapılandırma + update: + notice: Yapılandırma kaydedildi. + confirm: Emin misiniz? + finances: + index: + bank_accounts: Banka hesapları + first_paragraph: Burada finansal işlem sınıflarını ve ilgili finansal işlem türlerini yönetebilirsiniz. Her finansal işlemin bir türü vardır ve birden fazla tür oluşturduysanız, her işlemde seçmeniz gerekmektedir. Finansal işlem sınıfları, finansal işlem türlerini gruplamak için kullanılabilir ve birden fazla oluşturulmuşsa hesap özeti sayfasında ek sütunlar olarak gösterilir. + new_bank_account: Yeni banka hesabı ekle + new_financial_transaction_class: Yeni finansal işlem sınıfı ekle + new_bank_gateway: Yeni banka ağ geçidi ekle + title: Finanslar + transaction_types: Finansal işlem türleri + supplier_categories: Tedarikçi kategorileri + new_supplier_category: Yeni tedarikçi kategorisi + transaction_types: + name: İsim + new_financial_transaction_type: Yeni finansal işlem türü ekle + financial_transaction_classes: + form: + title_edit: Finansal işlem sınıfını düzenle + title_new: Yeni finansal işlem sınıfı ekle + financial_transaction_types: + form: + name_short_desc: Kısa isim, banka işlemlerinde otomatik olarak atanacak finansal işlem türleri için zorunludur. Birden fazla banka hesabı varsa, banka transferleri için tercih edilen hedef hesap seçilebilir. + title_edit: Finansal işlem türünü düzenle + title_new: Yeni finansal işlem türü ekle + mail_delivery_status: + destroy_all: + notice: Tüm e-posta problemleri silindi + index: + destroy_all: Tüm e-posta problemlerini sil + title: E-posta problemleri + ordergroups: + destroy: + error: 'Sipariş grubu silindi olarak işaretlenemedi: %{error}' + notice: Sipariş grubu silindi olarak işaretlendi + edit: + title: Sipariş grubunu düzenle + form: + first_paragraph: Yeni üyeleri %{url} davet edebilirsiniz. + here: buradan + index: + first_paragraph: Burada %{url} grupları ekleyebilir, düzenleyebilir veya silebilirsiniz. + new_ordergroup: Yeni sipariş grubu ekle + new_ordergroups: yeni sipariş grupları + second_paragraph: 'Grup ve sipariş grubu arasındaki farkı şöyle düşünün: Bir sipariş grubu bir hesaba sahiptir ve yiyecek siparişi verebilir. Bir %{url} (örneğin ''sınıflandırma grubu'') içindeki üyeler, görevler ve mesajlar yoluyla birbirleri arasında koordinasyon sağlar. Kullanıcılar sadece bir sipariş grubunda olabilir, ancak birden fazla çalışma grubunda olabilirler.' + title: Sipariş grupları + workgroup: çalışma grubu + new: + title: Yeni sipariş grubu oluştur + show: + confirm: Emin misiniz? + edit: Grup/Üyeleri Düzenle + title: Sipariş grubu %{name} + search_placeholder: isim ... + users: + controller: + sudo_done: Şimdi %{user} olarak giriş yaptınız. Dikkatli olun ve işiniz bittiğinde çıkış yapmayı unutmayın! + destroy: + error: 'Kullanıcı silinemedi: %{error}' + notice: Kullanıcı silindi + edit: + title: Kullanıcıyı Düzenle + form: + create_ordergroup: Aynı adı taşıyan bir sipariş grubu oluşturun ve kullanıcıyı ekleyin. + send_welcome_mail: Kullanıcıya hoş geldiniz e-postası gönderin. + index: + first_paragraph: Burada %{url}, düzenleyebilir ve silebilirsiniz. + new_user: Yeni kullanıcı oluşturabilir + new_users: yeni oluştur + show_deleted: Silinmiş kullanıcıları göster + title: Kullanıcı Yönetimi + new: + title: Yeni kullanıcı oluştur + restore: + error: 'Kullanıcı geri yüklenemedi: %{error}' + notice: Kullanıcı geri yüklendi + show: + confirm_sudo: Devam ederseniz, %{user} kimliğine bürüneceksiniz. İşiniz bittiğinde çıkış yapmayı unutmayın! + groupabos: Grup abonelikleri + member_since: Üye %{time} tarihinden bu yana + person: Kişi + preference: Tercihler + show_email_problems: E-posta sorunlarını göster + sudo: Kimliği kullanarak giriş yap + users: + show_email_problems: E-posta sorunlarını göster + workgroups: + destroy: + error: 'Çalışma grubu silinemedi: %{error}' + notice: Çalışma grubu silindi + edit: + title: Çalışma grubunu düzenle + form: + first_paragraph: Yeni üyeleri %{url} davet edebilirsiniz. + here: buradan + index: + first_paragraph: Burada %{url} oluşturabilir, düzenleyebilir ve silebilirsiniz. + new_workgroup: Yeni çalışma grubu oluştur + new_workgroups: yeni çalışma grupları + ordergroup: sipariş grubu + second_paragraph: 'Çalışma grubu ve sipariş grubu arasındaki farkı dikkate alın: bir %{url} hesabı vardır ve yemek siparişi verebilir. Bir çalışma grubunda (örneğin ''sınıflandırma grubu''), üyeler görevler ve mesajlar aracılığıyla birbirleri arasında koordinasyon sağlarlar. Kullanıcılar yalnızca bir sipariş grubunda olabilir, ancak birden fazla çalışma grubunda olabilirler.' + title: Çalışma Grupları + new: + title: Yeni çalışma grubu oluştur + show: + confirm: Emin misiniz? + edit: Grubu/kullanıcıları düzenle + title: Çalışma Grubu %{name} + workgroups: + members: üyeler + name: isim + supplier_categories: + form: + title_new: Tedarikçi kategorisi ekle + title_edit: Tedarikçi kategorisi düzenle + application: + controller: + error_authn: Kimlik doğrulama gerekiyor! + error_denied: İstenen sayfayı görüntülemeye yetkiniz yok. İlgili izinlere sahip olmanız gerektiğini düşünüyorsanız bir yöneticiye başvurun. Birden fazla kullanıcı hesabına erişiminiz varsa, %{sign_in} deneyin. + error_denied_sign_in: başka bir kullanıcı olarak oturum açmayı + error_feature_disabled: Bu özellik şu anda devre dışı bırakılmış durumda. + error_members_only: Bu eylem, yalnızca grubun üyeleri tarafından kullanılabilir! + error_minimum_balance: Maalesef hesap bakiyeniz %{min} minimumunun altında. + error_token: Erişim reddedildi (geçersiz belirteç)! + article_categories: + create: + notice: Kategori kaydedildi + destroy: + error: 'Kategori silinemiyor: %{message}' + edit: + title: Kategori düzenleme + index: + new: Yeni kategori ekle + title: Ürün kategorileri + new: + title: Yeni kategori ekleme + update: + notice: Kategori güncellendi + articles: + article: + last_update: 'son güncelleme: %{last_update} | brüt: %{gross_price}' + articles: + confirm_delete: Seçilen ürünleri gerçekten silmek istiyor musunuz? + option_available: Ürünleri uygun hale getir + option_delete: Ürünü sil + option_not_available: Ürünleri uygun değil yap + option_select: Bir eylem seçin ... + price_netto: Fiyat + unit_quantity_desc: Birim miktarı + unit_quantity_short: B.M. + controller: + create_from_upload: + notice: "%{count} yeni ürün kaydedildi." + error_invalid: Ürünlerde hatalar var + error_nosel: Seçilmiş bir ürün yok + error_parse: "%{msg} ... satır %{line}'da" + error_update: '%{article} ürünleri güncellerken bir hata oluştu: %{msg}' + parse_upload: + no_file: Lütfen yüklemek için bir dosya seçin. + notice: "%{count} ürün başarıyla analiz edildi." + sync: + notice: Katalog güncel + shared_alert: "%{supplier} harici bir veritabanına bağlı değil" + update_all: + notice: Tüm ürünler ve fiyatlar güncellendi. + update_sel: + notice_avail: Tüm seçili ürünler uygun olarak ayarlandı. + notice_destroy: Tüm seçili ürünler silindi. + notice_noaction: Hiçbir işlem belirtilmedi! + notice_unavail: Tüm seçili ürünler uygun değil olarak ayarlandı. + update_sync: + notice: Tüm ürünler ve fiyatlar güncellendi. + destroy_active_article: + drop: sil + note: "%{article} mevcut siparişlerde kullanılıyor ve silinemez. Lütfen önce ... ürünleri siparişlerden %{drop_link} kaldırın." + edit_all: + note: 'Zorunlu alanlar: ad, birim, (net) fiyat ve sipariş numarası.' + submit: Tüm ürünleri güncelle + title: "%{supplier} tedarikçisinin tüm ürünleri düzenle" + warning: 'Uyarı: tüm ürünler güncellenecek!' + form: + title_edit: Ürün düzenle + title_new: Yeni ürün ekle + import_search_results: + action_import: İçe aktar + already_imported: içe aktarıldı + not_found: Ürün bulunamadı + index: + change_supplier: Tedarikçi değiştir + download: Ürünleri indir + edit_all: Tümünü düzenle + ext_db: + import: Ürünü içe aktar + sync: Senkronize et + import: + category: Doğrudan kategoriye aktar + placeholder: Ad ile arama yapın ... + restrict_region: Sadece bölgeye özgü hale getir + title: Ürünü içe aktar + new: Yeni ürün + new_order: Yeni sipariş oluştur + search_placeholder: Ad ... + title: "%{supplier} ürünleri (%{count})" + upload: Ürünleri yükle + model: + error_in_use: "%{article}, bir mevcut siparişin parçası olduğu için silinemiyor!" + error_nosel: Hiçbir ürün seçmediniz + parse_upload: + body: "Lütfen ürünleri doğrulayın.
Dikkat, tekrar eden ürünler için şu anda herhangi bir kontrol yapılmıyor.
" + submit: Yüklemeyi işle + title: Ürünleri yükle + sync: + outlist: + alert_used: Uyarı, %{article} açık bir siparişte kullanılıyor. Lütfen önce siparişten kaldırın. + body: 'Aşağıdaki ürünler listeden çıkarıldı ve silinecek:' + body_ignored: + one: Sipariş numarası olmayan bir ürün atlandı. + other: "Sipariş numarası olmayan %{count} ürün atlandı." + body_skip: Silinecek ürün yok. + title: Listeden çıkar ... + price_short: Fiyat + submit: Tümünü senkronize et + title: Harici veritabanıyla ürünleri senkronize et + unit_quantity_short: Birim miktarı + update: + body: 'Her ürün iki kez gösterilir: eski değerler gri, metin alanları ise güncellenmiş değerler içerir. Eski ürünlerle farklılıklar sarı renkle işaretlenmiştir.' + title: Güncelle ... + update_msg: + one: Bir ürün güncellenmesi gerekiyor. + other: "%{count} ürün güncellenmesi gerekiyor." + upnew: + body_count: + one: Bir yeni ürün eklemek için. + other: Eklemek için %{count} ürün var. + title: Yeni ekle ... + upload: + fields: + reserved: "(Ayrılmış)" + status: Durum (x=atla) + file_label: Lütfen uyumlu bir dosya seçin + options: + convert_units: Mevcut birimleri koruyun, birim miktarını ve fiyatı yeniden hesaplayın (senkronize gibi). + outlist_absent: Yüklenen dosyada olmayan ürünleri sil. + sample: + juices: Meyve suları + nuts: Kuruyemişler + organic: Organik + supplier_1: Kuruyemişçi + supplier_2: Kahverengi tarladan + supplier_3: Yeşil tarladan + tomato_juice: Domates suyu + walnuts: Cevizler + submit: Dosyayı yükle + text_1: '%{supplier} ürünlerini güncellemek için bir elektronik tablo yükleyebilirsiniz. Excel (xls, xlsx) ve OpenOffice (ods) tabloları kabul edilir, virgülle ayrılmış dosyalar da kabul edilir (csv, utf-8 kodlamalı "; " ile ayrılmış sütunlar). Sadece ilk sayfa içe aktarılacak ve sütunlar aşağıdaki sıraya göre olmalıdır:' + text_2: Burada gösterilen satırlar örneklerdir. İlk sütunda "x" olduğunda, ürün listeden çıkarılır ve silinir. Bu, örneğin tedarikçiyle ürünler müsait olmadığında birçok ürünü hızlı bir şekilde kaldırmak için elektronik tabloyu düzenlemenize ve çıkarmanıza izin verir. Kategori, Foodsoft kategori listenize eşleştirilecek (hem kategori adı hem de içe aktarma adlarıyla). + title: "%{supplier} ürünlerini yükle" + bank_account_connector: + confirm: Lütfen %{code} kodunu onaylayın. + fields: + email: E-Posta + pin: PIN + password: Şifre + tan: TAN + username: Kullanıcı adı + config: + hints: + applepear_url: Görevler için kullanılan elma ve armut sisteminin açıklandığı web sitesi. + charge_members_manually: Üyelerin ne aldığını başka bir yerde takip ettiğinizde (örneğin kağıt üzerinde), bunu Foodsoft'a girmek istemezseniz, bunu seçin. Üye hesaplarını manuel olarak ücretlendirmeniz gerekecektir ("Yeni işlem ekle" kullanarak). Denge ekranında hala siparişleri uzlaştırmanız gerekecek, ancak üye hesaplarına ücret yansıtılmayacak. + contact: + email: Genel iletişim e-posta adresi, web sitesinde ve bazı formlarda gösterilir. + street: Adres, genellikle teslimat ve toplama noktanız olacaktır. + currency_space: Para birimi simgesinin ardından boşluk ekleyip eklemediğinizi belirtir. + currency_unit: Fiyatları görüntülemek için para birimi simgesi. + custom_css: Bu site'nin düzenini değiştirmek için, kaskatı stili (CSS) dilini kullanarak stil değişiklikleri yapabilirsiniz. Varsayılan stili kullanmak için boş bırakın. + email_from: E-postalar bu e-posta adresinden gönderilecek. Foodcoop'un iletişim adresini kullanmak için boş bırakın. + email_replyto: Foodsoft tarafından gönderilen e-postalardan farklı bir adresten yanıt almak istediğinizde bunu ayarlayın. + email_sender: E-postalar bu e-posta adresinden gönderilir. Gönderen e-posta adresinin etki alanının SPF kaydına web sunucusunun kaydedilmesi gerekebilir, böylece gönderilen e-postalar spam olarak sınıflandırılmaz. + help_url: Belgelendirme web sitesi. + homepage: Yiyecek kooperatifinizin web sitesi. + ignore_browser_locale: Kullanıcının henüz bir dil seçmediği zaman kullanıcının bilgisayarının dilini yoksayın. + minimum_balance: Üyeler, hesap bakiyelerinin bu miktarın üzerinde veya eşit olduğu durumlarda sadece sipariş verebilirler. + name: Yiyecek kooperatifinizin adı. + order_schedule: + boxfill: + recurr: Kutuları-doldurma aşamasının varsayılan başlama zamanı. + time: Siparişin başlangıç saati. + ends: + recurr: Varsayılan sipariş kapanma tarihi için plan. + time: Siparişlerin kapatılacağı varsayılan saat. + initial: Program bu tarihte başlar. + page_footer: Her sayfanın altında gösterilir. Tamamen devre dışı bırakmak için "boş" girin. + pdf_add_page_breaks: + order_by_articles: Her ürünü ayrı bir sayfada göster. + order_by_groups: Her sipariş grubunu ayrı bir sayfada göster. + pdf_font_size: PDF belgeleri için temel yazı tipi boyutu (standart 12'dir). + pdf_page_size: PDF belgeleri için sayfa boyutu, genellikle "A4" veya "zarf". + price_markup: Üyelerin toplam fiyatına eklenen yüzde. + stop_ordering_under: Üyeler sadece bu kadar elma puanı olduğunda sipariş verebilirler. + tasks_period_days: İki periyodik görev arasındaki gün sayısı (varsayılan olarak 7, yani bir hafta). + tasks_upfront_days: Periyodik görevleri kaç gün önceden planlamak istediğinize bağlı olarak değişir. + tax_default: Yeni ürünler için varsayılan KDV yüzdesi. + tolerance_is_costly: Üye toleransını maksimum dolduracak kadar sipariş edin (sadece son kutuyu dolduracak kadar ürün eklemek yerine). Açık siparişin toplam tutarına uygulanan tolerans da buna dahildir. + distribution_strategy: Bir sipariş alındıktan sonra ürünlerin nasıl dağıtılacağı. + use_apple_points: Elma puanı sistemi etkinleştirildiğinde, üyeler sipariş vermeye devam edebilmek için bazı görevleri yapmak zorundadırlar. + use_boxfill: Etkinleştirildiğinde, siparişin sonuna doğru, üyeler yalnızca toplam sipariş tutarını artırdığında siparişlerini değiştirebilirler. Bu, kalan kutuları doldurmaya yardımcı olur. Siparişler için bir kutuları-doldurma tarihi belirlemelisiniz. + use_iban: Etkinleştirildiğinde, tedarikçi ve kullanıcı uluslararası banka hesap numaralarını saklayabileceği ek bir alan sunar. + use_nick: Gerçek adlar yerine takma adları göster ve kullan. Bu seçeneği etkinleştirdiğinizde, her kullanıcının bir takma adı olup olmadığını kontrol edin. + use_self_service: Seçili dengeleme (balancing) işlevlerini üyeler kendileri kullanabilirler. + webstats_tracking_code: Web analitiği için takip kodu (Piwik veya Google analytics gibi). Takip etmek istemiyorsanız boş bırakın. + keys: + applepear_url: Elma sistemi yardım URL'si + charge_members_manually: Üyeleri manuel olarak şarj et + contact: + city: Şehir + country: Ülke + email: E-posta + phone: Telefon + street: Cadde/Sokak + zip_code: Posta kodu + currency_space: Boşluk ekle + currency_unit: Para birimi + custom_css: Özel CSS + default_locale: Varsayılan dil + default_role_article_meta: Ürünler + default_role_finance: Finans + default_role_invoices: Faturalar + default_role_orders: Siparişler + default_role_pickups: Alım günleri + default_role_suppliers: Tedarikçiler + disable_invite: Davetiyeleri devre dışı bırak + email_from: Adresinden + email_replyto: Yanıtlanacak adres + email_sender: Gönderen adresi + help_url: Belgeleme URL'si + homepage: Ana sayfa + ignore_browser_locale: Tarayıcı dilini yoksay + minimum_balance: Minimum bakiye + name: İsim + order_schedule: + boxfill: + recurr: Kutu doldurma sonrası + time: zaman + ends: + recurr: Sipariş sonu + time: zaman + initial: Program başlangıcı + page_footer: Sayfa altbilgisi + pdf_add_page_breaks: Sayfa atlamaları + pdf_font_size: Yazı tipi boyutu + pdf_page_size: Sayfa boyutu + price_markup: Foodcoop marjı + stop_ordering_under: Minimum elma puanı + tasks_period_days: Dönem + tasks_upfront_days: Önceden oluştur + tax_default: Varsayılan KDV + time_zone: Zaman dilimi + tolerance_is_costly: Tolerans maliyetlidir + distribution_strategy: Dağıtım stratejisi + distribution_strategy_options: + first_order_first_serve: İlk sipariş edenlere öncelik verin + no_automatic_distribution: Otomatik dağıtım yok + use_apple_points: Elma puanları kullan + use_boxfill: Kutuları-doldurma aşamasını kullan + use_iban: IBAN kullan + use_nick: Takma ad kullan + use_self_service: Kendi kendine (self service) hizmet kullan + webstats_tracking_code: Takip kodu + tabs: + applications: Uygulamalar + foodcoop: Foodcoop + language: Dil + layout: Düzen + list: Liste + messages: Mesajlar + others: Diğerleri + payment: Finans + security: Güvenlik + tasks: Görevler + deliveries: + add_stock_change: + how_many_units: 'Kaç birim (%{unit}) teslim edilecek? Stoğun adı: %{name}.' + create: + notice: Teslimat oluşturuldu. Lütfen fatura eklemeyi unutmayın! + destroy: + notice: Teslimat silindi. + edit: + title: Teslimatı düzenle + form: + confirm_foreign_supplier_reedit: Stok ürünü %{name} başarıyla kaydedildi. Ancak, bu teslimatın tedarikçisinden farklı bir tedarikçiye ait. Stok ürününü tekrar düzenlemek ister misiniz? + create_from_blank: Yeni ürün oluştur + create_stock_article: Stok ürünü oluştur + title_fill_quantities: 2. Teslimat miktarlarını belirle + title_finish_delivery: 3. Teslimatı tamamla + title_select_stock_articles: 1. Stok ürünlerini seç + index: + confirm_delete: Silmek istediğinizden emin misiniz? + new_delivery: '%{supplier} için yeni teslimat oluştur ' + title: "%{supplier}/teslimatlar" + invoice_amount: Fatura tutarı + invoice_net_amount: Fatura net tutarı + new: + title: "%{supplier} için yeni teslimat" + show: + sum: Toplam + sum_diff: Brüt - fatura tutarı + sum_gross: Brüt toplam + sum_net: Net toplam + title: Teslimatı göster + title_articles: Ürünler + stock_article_for_adding: + action_add_to_delivery: Teslimata ekle + action_edit: Düzenle + action_other_price: Kopyala + stock_change_fields: + remove_article: Teslimattan çıkar + suppliers_overview: Tedarikçi genel bakış + update: + notice: Teslimat güncellendi. + documents: + order_by_articles: + filename: Sipariş %{name}-%{date} - ürünlere göre + title: '%{name} için ürünlere göre sıralanmış sipariş, %{date} tarihinde kapanmıştır' + order_by_groups: + filename: Sipariş %{name}-%{date} - gruba göre + sum: Toplam + title: '%{name} için gruba göre sıralanmış sipariş, %{date} tarihinde kapanmıştır' + order_fax: + filename: Sipariş %{name}-%{date} - Faks + rows: + - Sipariş Numarası + - Miktar + - Ad + - Birim miktarı + - Birim + - Birim fiyatı + - Ara toplam + total: Toplam + order_matrix: + filename: Sipariş %{name}-%{date} - sıralama matrisi + heading: Ürün genel bakışı (%{count}) + title: '%{date} tarihinde kapatılan %{name} sipariş sıralama matrisi' + errors: + general: Bir problem oluştu. + general_again: Bir problem oluştu. Lütfen tekrar deneyin. + general_msg: 'Bir problem oluştu: %{msg}' + internal_server_error: + text1: Beklenmeyen bir hata oluştu. Özür dileriz! + text2: Bildirildi. Eğer sorun devam ederse, bize bildirin lütfen. + title: Dahili sunucu hatası + not_found: + text: Bu sayfa mevcut değil, üzgünüz! + title: Sayfa bulunamadı + feedback: + create: + notice: Geri bildiriminiz başarıyla gönderildi. Teşekkür ederiz! + new: + first_paragraph: Bir hata buldunuz mu? Önerileriniz mi var? Fikirleriniz mi? Geri bildirimlerinizi duymaktan mutluluk duyarız. + second_paragraph: Lütfen unutmayın, Foodsoft ekibi yalnızca yazılımın bakımından sorumludur. Foodcoop'unuzun organizasyonuyla ilgili sorularınız için uygun kişiye başvurmanız gerekmektedir. + send: Gönder + title: Geri Bildirim Ver + finance: + balancing: + close: + alert: 'Muhasebe yapılırken bir hata oluştu: %{message}' + notice: Sipariş başarıyla tamamlandı, hesap bakiyesi güncellendi. + close_all_direct_with_invoice: + notice: '%{count} sipariş tamamlandı.' + close_direct: + alert: 'Sipariş tamamlanamadı: %{message}' + notice: Sipariş tamamlandı. + confirm: + clear: Hesapla + first_paragraph: 'Sipariş tamamlandığında, tüm grup hesapları güncellenecektir.Burada Gıda Kooperatifinizin üyelerine bir mesaj yazabilirsiniz. Diğer üyelerin sizinle iletişim kurmasını isterseniz, bunu %{profile_link} bölümünden etkinleştirin.
" + ph_name: İsim ... + ph_ordergroup: Sipariş grubu ... + profile_link: seçenekler + title: Kullanıcılar + workgroups: + edit: + invite_link: burada + invite_new: Yeni üyeleri %{invite_link} davet edebilirsiniz. + title: Grubu Düzenle + index: + body: "Bir grubu düzenlemek yalnızca grubun üyeleri tarafından yapılabilir.
Bir gruba katılmak istiyorsanız, lütfen üyelere bir mesaj gönderin.
Burada, Foodcoop'un üyesi olmayan bir kişiyi <%{group}> gruplarına davet edebilirsiniz. Davet kabul edildikten sonra, kişi siparişinize ürün ekleyebilecek (ve kaldırabilecek).
Bu, birini foodcoop'a tanıtmak veya aynı evde birden fazla kişiyle sipariş vermeye yardımcı olmak için harika bir yoldur.
" + title: Kişi davet et + new: + action: Davet gönder + body: "Burada, henüz Foodcoop üyesi olmayan bir kişiyi <%{group}> grubuna ekleyebilirsiniz.
" + success: Kullanıcı başarıyla davet edildi. + js: + ordering: + confirm_change: Bu siparişe yapılan değişiklikler kaybolacak. Değişikliklerinizi kaybetmek ve devam etmek istiyor musunuz? + trix_editor: + file_size_alert: Dosya eki çok büyük! Maksimum boyut 512Mb + layouts: + email: + footer_1_separator: "--" + footer_2_foodsoft: 'Foodsoft: %{url}' + footer_3_homepage: 'Foodcoop: %{url}' + footer_4_help: 'Yardım: %{url}' + foodsoft: Foodsoft + footer: + revision: revizyon %{revision} + header: + feedback: + desc: Bir hata mı buldunuz? Öneriler? Fikirler? İnceleme? + title: Geri bildirim + help: Yardım + logout: Çıkış yap + ordergroup: Benim sipariş grubum + profile: Profili düzenle + reference_calculator: Referans Hesaplayıcı + logo: "foodsoft" + lib: + render_pdf: + page: "%{count} sayfasının %{number}. sayfası" + login: + accept_invitation: + body: "%{foodcoop} gıda kooperatifinin %{group} grubunun bir üyesi olarak davet edildiniz.
Katılmak isterseniz, lütfen bu formu doldurun.
Doğal olarak, kişisel bilgileriniz herhangi bir nedenle üçüncü taraflarla paylaşılmayacaktır. Tüm'ü, tüm Gıda Kooperatifleri üyeleri için görünür olacak şekilde kişisel bilgilerinizin ne kadarının görünür olacağını siz belirleyebilirsiniz. Lütfen not edin ki, yöneticiler bilgilerinize erişebilirler.
" + submit: Bir Foodsoft hesabı oluşturun + title: "%{name} için davet" + controller: + accept_invitation: + notice: Tebrikler, hesabınız başarıyla oluşturuldu. Şimdi giriş yapabilirsiniz. + error_group_invalid: Davet edildiğiniz grup artık mevcut değil. + error_invite_invalid: Davetiniz geçersiz (artık geçerli değil). + error_token_invalid: Geçersiz veya süresi dolmuş belirteç (token). Lütfen tekrar deneyin. + reset_password: + notice: Eğer e-postanız kayıtlıysa, şifrenizi sıfırlamak için bir bağlantı içeren bir mesaj alacaksınız. Spam klasörünüzü kontrol etmeniz gerekebilir. + update_password: + notice: Şifreniz güncellendi. Artık giriş yapabilirsiniz. + forgot_password: + body: "Sorun değil, yeni bir şifre seçebilirsiniz.
Lütfen burada kayıtlı olan e-posta adresinizi girin. Daha fazla talimat için bir e-posta alacaksınız.
" + submit: Yeni şifre iste + title: Şifremi unuttum? + new_password: + body: "%{user} için yeni şifreyi girin.
" + submit: Yeni şifreyi kaydet + title: Yeni şifre + mailer: + dateformat: "%d %b" + feedback: + header: "%{user} tarafından %{date} tarihinde yazıldı:" + subject: Foodsoft için geri bildirim + from_via_foodsoft: "%{name} Foodsoft aracılığıyla" + invite: + subject: Foodcoop Davetiyesi + text: | + Merhaba! + + %{user} <%{mail}> seni "%{group}" grubuna katılmaya davet etti. + Davetiye kabul etmek ve foodcoop'a katılmak için lütfen bu bağlantıyı takip et: %{link} + Bu bağlantı sadece bir kez kullanılabilir ve %{expires} tarihinde süresi dolacaktır. + + + Sevgiler, Foodsoft Ekibi! + negative_balance: + subject: Negatif hesap bakiyesi + text: | + Sayın %{group}, + + Hesap bakiyeniz %{when} tarihinde yapılan %{amount} TL'lik işlem nedeniyle sıfırın altına düştü: "%{balance}" + + "%{user}" tarafından "%{note}" için %{amount} ücret alındı. + + Lütfen mümkün olan en kısa sürede hesabınıza para yatırınız. + + + + %{foodcoop} adına saygılar. + not_enough_users_assigned: + subject: '"%{task}" için hala kişilere ihtiyaç var!' + text: | + Sevgili %{user}, + + Çalışma grubunun '%{task}' görevi %{when} tarihinde tamamlanacak + ve daha fazla katılımcıya ihtiyaç duyuyor! + + Eğer henüz bu göreve atanmadıysanız, şimdi fırsatınız var: + + %{workgroup_tasks_url} + + Görevleriniz: %{user_tasks_url} + order_result: + subject: '%{name} siparişi kapatıldı' + text0: | + Sevgili %{ordergroup}, + + "%{order}" siparişi %{user} tarafından %{when} tarihinde kapatıldı. + text1: | + Tahmini olarak %{pickup} tarihinde teslim edilebilir. + text2: | + Sipariş grubunuz için aşağıdaki ürünler sipariş edildi: + text3: |- + o Toplam tutar: %{sum} + + Siparişi çevrimiçi olarak görüntüleyebilirsiniz: %{order_url} + + + %{foodcoop} adına sevgiler. + order_received: + subject: '%{name} için sipariş teslimi kaydedildi' + text0: | + Sevgili %{ordergroup}, + + "%{order}" için sipariş teslimi kaydedilmiştir. + abundant_articles: Fazla alındı + scarce_articles: Az alındı + article_details: | + o %{name}: + -- Sipariş edilen: %{ordered} x %{unit} + -- Alınan: %{received} x %{unit} + order_result_supplier: + subject: '%{name} için yeni sipariş' + text: | + Merhaba! + + %{foodcoop} Foodcoop'u sipariş vermek istiyor. + + Lütfen ekli PDF ve hesap tablosunu inceleyiniz. + + Saygılarımızla, + %{user} + %{foodcoop} + reset_password: + subject: '%{username} için yeni şifre' + text: | + Merhaba %{user}, + + Yeni bir şifre istediniz (veya başka birisi istedi). + Yeni bir şifre belirlemek için bu linke tıklayın: %{link} + Bu link sadece bir kez kullanılabilir ve %{expires} tarihinde geçersiz olacaktır. + Eğer şifrenizi değiştirmek istemiyorsanız, bu mesajı görmezden gelebilirsiniz. Şifreniz henüz değiştirilmedi. + + + Saygılarımızla, Foodsoft Ekibi! + upcoming_tasks: + nextweek: 'Gelecek hafta için görevler:' + subject: Görevler teslim edilmeli! + text0: | + Sayın %{user}, + + %{task} görevi size atanmıştır. Bu görev yarın (%{when}) teslim edilmelidir! + text1: | + Görevlerim: %{user_tasks_url} + + + %{foodcoop} adına saygılarımızla. + welcome: + subject: "%{foodcoop} Hoş Geldiniz" + text0: | + Sayın %{user}, + + %{foodcoop} için yeni bir Foodsoft hesabı oluşturuldu. + text1: | + Yeni bir şifre belirlemek için lütfen şu bağlantıyı takip edin: %{link} + Bu bağlantı sadece bir kez kullanılabilir ve %{expires} tarihinde geçerliliğini yitirir. + Her zaman "Şifrenizi mi unuttunuz?" seçeneğini kullanarak yeni bir bağlantı alabilirsiniz. + + + %{foodcoop} adına saygılarımızla. + messages_mailer: + foodsoft_message: + footer: | + Yanıtla: %{reply_url} + Mesajı çevrimiçi görüntüle: %{msg_url} + Mesaj seçenekleri: %{profile_url} + footer_group: | + Gruba gönderildi: %{group} + model: + delivery: + each_stock_article_must_be_unique: Her stok ürünü bir kez listelenmeli. + financial_transaction: + foodcoop_name: Gıda kooperatifi + financial_transaction_type: + no_delete_last: En az bir finansal işlem türü bulunmalıdır. + group_order: + stock_ordergroup_name: Stok (%{user}) + invoice: + invalid_mime: geçersiz bir MIME türüne sahip (%{mime}) + membership: + no_admin_delete: Son kalan yönetici olduğunuz için üyelikten çıkılamaz. + order_article: + error_price: belirtilmeli ve geçerli bir fiyata sahip olmalıdır + user: + no_ordergroup: sıfır sipariş grubu + group_order_article: + order_closed: Sipariş kapatıldı ve değiştirilemez. + navigation: + admin: + config: Konfigürasyon + finance: Finans + home: Genel Bakış + mail_delivery_status: E-posta sorunları + ordergroups: Sipariş Grupları + title: Yönetim + users: Kullanıcılar + workgroups: Çalışma Grupları + articles: + categories: Kategoriler + stock: Stok + suppliers: Tedarikçiler/ürünler + title: Ürünler + dashboard: Kontrol Paneli + finances: + accounts: Hesapları Yönet + balancing: Hesap siparişleri + bank_accounts: Banka Hesapları + home: Genel Bakış + invoices: Faturalar + title: Finanslar + foodcoop: Gıda Kooperatifi + members: Üyeler + ordergroups: Sipariş Grupları + orders: + archive: Benim Siparişlerim + manage: Siparişleri Yönet + ordering: Sipariş Ver! + pickups: Teslim Günleri + title: Siparişler + tasks: Görevler + workgroups: Çalışma Grupları + number: + percentage: + format: + strip_insignificant_zeros: true + order_articles: + edit: + stock_alert: Stok ürünlerinin fiyatı değiştirilemez! + title: Ürünü güncelle + new: + title: Teslim edilen ürünü siparişe ekle + ordergroups: + edit: + title: Sipariş gruplarını düzenle + index: + title: Sipariş grupları + model: + error_single_group: "%{user}, başka bir sipariş grubunun üyesidir" + invalid_balance: geçerli bir sayı değil + orders: + articles: + article_count: 'Sipariş edilen ürünler:' + prices: Net/brüt fiyatı + prices_sum: 'Toplam (net/brüt fiyat):' + units_full: Tam birimler + units_ordered: Sipariş edilen birimler + create: + notice: Sipariş oluşturuldu. + edit: + title: 'Siparişi düzenle: %{name}' + edit_amount: + field_locked_title: Bu ürünün sipariş grupları arasındaki dağılımı manuel olarak değiştirildi. Bu alan, bu değişiklikleri korumak için kilitlidir. Yeni bir dağılım yapmak ve bu değişiklikleri üzerine yazmak için kilidi açın ve miktarı değiştirin. + field_unlocked_title: Bu ürünün sipariş grupları arasındaki dağılımı manuel olarak değiştirildi. Miktarı değiştirirken, bu manuel değişiklikler üzerine yazılacaktır. + edit_amounts: + no_articles_available: Eklenecek ürün yok. + set_all_to_zero: Tümünü sıfıra ayarla + fax: + amount: Miktar + articles: Ürünler + delivery_day: Teslim günü + heading: "%{name} için sipariş" + name: İsim + number: Numara + to_address: Gönderim adresi + finish: + notice: Sipariş kapatıldı. + form: + ignore_warnings: Uyarıları yok say + prices: Fiyatlar (net/FC) + select_all: Hepsini seç + stockit: Stokta + title: Ürün + index: + action_end: Kapat + action_receive: Teslim al + confirm_delete: Siparişi gerçekten silmek istiyor musunuz? + confirm_end: Siparişi gerçekten kapatmak istiyor musunuz %{order}? Geri dönüş yok. + new_order: Yeni sipariş oluştur + no_open_or_finished_orders: Şu anda açık veya kapalı sipariş yok. + orders_finished: Kapatıldı + orders_open: Açık + orders_settled: Düzenlendi + title: Siparişleri yönet + model: + close_direct_message: Üye hesaplarına ücret yansıtılmadan sipariş kapatıldı. + error_boxfill_before_ends: Kutu doldurma tarihi son tarihten önce olmalıdır (veya boş bırakılmalıdır). + error_closed: Sipariş zaten kapatılmış + error_nosel: En az bir ürün seçilmelidir. Ya da belki siparişi silmek istiyor olabilirsiniz? + error_starts_before_boxfill: Başlangıç tarihi kutu doldurma tarihinden sonra olmalıdır (veya boş bırakılmalıdır). + error_starts_before_ends: Başlangıç tarihi bitiş tarihinden sonra olmalıdır (veya boş bırakılmalıdır). + notice_close: '%{name} siparişi, %{ends} kadar.' + stock: Stok + warning_ordered: 'Uyarı: Kırmızı olarak işaretlenen ürünler bu açık siparişte zaten sipariş edildi. Burada işaretini kaldırırsanız, tüm bu ürünlerin mevcut siparişleri silinecektir. Devam etmek için aşağıdaki onaylayın.' + warning_ordered_stock: 'Uyarı: Kırmızı olarak işaretlenen ürünler bu açık stok siparişinde zaten sipariş edildi/satın alındı. Burada seçimleri kaldırırsanız, tüm bu ürünlerin mevcut siparişleri/satı nalımları silinecek ve bunlar hesaba katılmayacaktır. Devam etmek için aşağıda onay verin.' + new: + title: Yeni sipariş oluştur + receive: + add_article: Ürün ekle + consider_member_tolerance: toleransı dikkate al + notice: '%{msg} siparişi alındı.' + notice_none: Teslim alınacak yeni bir ürün yok + paragraph: Sipariş edilen ve alınan miktar aynıysa, ilgili alanlar boş bırakılabilir. Yine de tüm alanların girilmesi iyi olur, çünkü bu, tüm ürünlerin kontrol edildiğinin anlaşılmasını sağlar. + rest_to_stock: stokta kalanlar + submit: Siparişi Al + surplus_options: 'Dağıtım Seçenekleri:' + title: "%{order} Siparişini Al" + send_to_supplier: + notice: Sipariş tedarikçiye gönderildi. + show: + action_end: Kapat! + amounts: 'Net/Brüt toplam:' + articles: Ürün özeti + articles_ordered: 'Sipariş edilen üründür:' + comments: + title: Yorumlar + comments_link: Yorumlar + confirm_delete: Siparişi gerçekten silmek istiyor musunuz? + confirm_end: |- + Siparişi gerçekten kapatmak istiyor musunuz %{order}? + Geri dönüşü yok. + confirm_send_to_supplier: Sipariş %{when} tarihinde zaten tedarikçiye gönderildi. Yeniden göndermek istiyor musunuz? + create_invoice: Fatura Ekle + description1_order: "%{who} tarafından açılan %{supplier} siparişi, %{state}," + description1_period: + pickup: alınabileceği tarih %{pickup} + starts: '%{starts} tarihinden itibaren açık' + starts_ends: '%{starts} tarihinden %{ends} tarihine kadar açık' + description2: "%{ordergroups} %{article_count} adet ürün sipariş verdi, toplam değeri %{net_sum} / %{gross_sum} (net / brüt)." + group_orders: 'Grup siparişleri:' + search_placeholder: + articles: Ürün ara... + default: Arama yap... + groups: Sipariş grupları ara... + search_reset: Aramayı sıfırla + send_to_supplier: Tedarikçiye gönder + show_invoice: Faturayı göster + sort_article: Ürüne göre sırala + sort_group: Gruba göre sırala + stock_order: Stok Siparişi + title: '%{name} Siparişi' + warn_not_closed: Uyarı, sipariş henüz kapatılmadı. + state: + closed: kapatıldı + finished: tamamlandı + open: açık + received: alındı + update: + notice: Sipariş güncellendi. + update_order_amounts: + msg1: "%{count} adet (%{units} birim) güncellendi" + msg2: "%{count} (%{units}) tolerans kullanılarak güncellendi" + msg4: "%{count} (%{units}) fazla kaldı" + pickups: + document: + empty_selection: En az bir sipariş seçmelisiniz. + filename: "%{date} Teslimatı" + invalid_document: Geçersiz belge türü + title: "%{date} Teslimatı" + index: + article_pdf: Ürün PDF'i + group_pdf: Grup PDF'i + matrix_pdf: Matris PDF'i + title: Teslimat günleri + sessions: + logged_in: Giriş yapıldı! + logged_out: Çıkış yapıldı! + login_invalid_email: Geçersiz e-posta adresi veya şifre + login_invalid_nick: Geçersiz kullanıcı adı veya şifre + new: + forgot_password: Şifremi unuttum? + login: Giriş Yap + nojs: Dikkat, çerezlerin ve javascript'in etkinleştirilmesi gerekiyor! Lütfen %{link} kapatın. + noscript: NoScript + title: Foodsoft Girişi + shared: + articles: + ordered: Sipariş edilen + ordered_desc: Üye tarafından sipariş edilen ürün sayısı (miktar + tolerans) + received: Alınan + received_desc: Üye tarafından alınan ürün sayısı + articles_by: + price: Toplam fiyat + price_sum: Toplam + group: + access: Erişim + activated: aktifleştirildi + apple_limit: Elma puanı sipariş sınırı + break: "%{start} - %{end} arası" + deactivated: devre dışı bırakıldı + group_form_fields: + search: Ara ... + search_user: Kullanıcı ara + user_not_found: Kullanıcı bulunamadı + open_orders: + no_open_orders: Şu anda açık sipariş yok + not_enough_apples: Dikkat! Sipariş grubunuzun yeterli miktarda elma puanı bulunmamaktadır. + title: Mevcut siparişler + total_sum: Toplam tutar + who_ordered: Kim sipariş verdi? + order_download_button: + article_pdf: Ürün PDF'i + download_file: Dosya indir + fax_csv: Faks CSV'si + fax_pdf: Faks PDF'i + fax_txt: Faks metni + group_pdf: Grup PDF'i + matrix_pdf: Matris PDF'i + title: İndir + task_list: + accept_task: Görevi kabul et + done: Tamamlandı + done_q: Tamamlandı mı? + mark_done: Görevi tamamlandı olarak işaretle + reject_task: Görevi reddet + who: Kim yapıyor? + who_hint: "(Ne kadarı hala gerekiyor?)" + user_form_fields: + contact_address_hint: Sipariş grubunuzun adresi. Burayı güncellerseniz, diğer üyeler de güncellenir. + messagegroups: Mesaj gruplarına katılın veya ayrılın + workgroup_members: + title: Grup üyelikleri + simple_form: + error_notification: + default_message: Hatalar bulundu. Lütfen formu kontrol edin. + hints: + article: + unit: Örn. KG veya 1L veya 500g + article_category: + description: İçe aktarım/senkronizasyonda tanınan kategori adlarının virgülle ayrılmış listesi + order_article: + units_to_order: Teslim edilen toplam birim miktarını değiştirirseniz, ayrı ayrı grup miktarlarını değiştirmek için ürün adına tıklamanız gerekir. Bunlar otomatik olarak yeniden hesaplanmayacağından, sipariş grupları teslim edilmemiş ürünler için borçlu kalabilirler! + update_global_price: Ayrıca gelecekteki siparişlerin fiyatını da güncelleyin + stock_article: + copy: + name: Lütfen değiştirin + edit_stock_article: + price: "Harici veritabanındaki tedarikçiler burada görüntülenir.
Dış tedarikçileri abone olarak içe aktarabilirsiniz (aşağıya bakın).
Yeni bir tedarikçi oluşturulacak ve harici veritabanına bağlanacaktır.
" + subscribe: Abone ol + subscribe_again: Tekrar abone ol + supplier: Tedarikçi + title: Harici listeler + show: + last_deliveries: Son teslimatlar + last_orders: Son siparişler + new_delivery: Yeni teslimat + show_deliveries: Tümünü göster + update: + notice: Tedarikçi güncellendi + tasks: + accept: + notice: Görevi kabul ettiniz + archive: + title: Görev arşivi + create: + notice: Görev oluşturuldu + destroy: + notice: Görev silindi + edit: + submit_periodic: Tekrarlayan görevi kaydet + title: Görevi düzenle + title_periodic: Tekrarlayan görevi düzenle + warning_periodic: "Uyarı: Bu görev, tekrar eden görevler grubunun bir parçasıdır. Kaydedildiğinde gruptan çıkarılacak ve bir normal göreve dönüştürülecektir." + error_not_found: Hiçbir çalışma grubu bulunamadı + form: + search: + hint: Kullanıcı ara + noresult: Kullanıcı bulunamadı + placeholder: Ara ... + submit: + periodic: Tekrarlayan görevi kaydet + index: + show_group_tasks: Grup görevlerini göster + title: Görevler + title_non_group: Tüm görevler + nav: + all_tasks: Tüm görevler + archive: Tamamlanmış görevler (arşiv) + group_tasks: Grup görevleri + my_tasks: Görevlerim + new_task: Yeni görev oluştur + pages: Sayfalar + new: + submit_periodic: Yinelenen görev oluştur + title: Yeni görev oluştur + repeated: Görev yineleniyor + set_done: + notice: Görev durumu güncellendi + show: + accept_task: Görevi kabul et + confirm_delete_group: Bu ve sonraki tüm görevleri gerçekten silmek istiyor musunuz? + confirm_delete_single: Görevi silmek istediğinizden emin misiniz? + confirm_delete_single_from_group: Bu görevi (ilişkili yinelenen görevleri tutarak) silmek istediğinizden emin misiniz? + delete_group: Görevi ve takip edenleri sil + edit_group: Tekrarlayanı düzenle + hours: "%{count}s" + mark_done: Görevi tamamlandı olarak işaretle + reject_task: Görevi reddet + title: Görevi göster + update: + notice: Görev güncellendi. + notice_converted: Görev güncellendi ve tekrarlanmayan bir göreve dönüştürüldü. + user: + more: Yapacak hiçbir şey yok mu? %{tasks_link} kesinlikle görevler var. + tasks_link: Burada + title: Görevlerim + title_accepted: Kabul edilen görevler + title_open: Açık görevler + workgroup: + title: '%{workgroup} için görevler' + title_all: Tüm grup görevleri + ui: + actions: İşlemler + back: Geri + cancel: İptal + close: Kapat + confirm_delete: "%{name} silmek istediğinizden emin misiniz?" + confirm_restore: "%{name} geri yüklemek istediğinizden emin misiniz?" + copy: Kopyala + delete: Sil + download: İndir + edit: Düzenle + marks: + close: "×" + success: + move: Taşı + or_cancel: ya da iptal + please_wait: Lütfen bekleyin... + restore: Geri yükle + save: Kaydet + search_placeholder: Ara... + show: Göster + views: + pagination: + first: "«" + last: "»" + next: "›" + previous: "‹" + truncate: "..." + workgroups: + edit: + title: Çalışma grubunu düzenle + error_last_admin_group: Yönetici hakları olan son grup silinemez + error_last_admin_role: Yönetici hakları olan son gruptan yönetici rolü geri alınamaz + index: + title: Çalışma Grupları + update: + notice: Çalışma grubu güncellendi. + time: + formats: + foodsoft_datetime: "%d.%b.%Y %H:%M" diff --git a/config/navigation.rb b/config/navigation.rb index c8b7d088..f483989f 100644 --- a/config/navigation.rb +++ b/config/navigation.rb @@ -12,7 +12,7 @@ SimpleNavigation::Configuration.run do |navigation| primary.item :dashboard_nav_item, I18n.t('navigation.dashboard'), root_path(anchor: '') primary.item :foodcoop, I18n.t('navigation.foodcoop'), '#' do |subnav| - subnav.item :members, I18n.t('navigation.members'), foodcoop_users_path + subnav.item :members, I18n.t('navigation.members'), foodcoop_users_path, unless: proc { FoodsoftConfig[:disable_members_overview] } subnav.item :workgroups, I18n.t('navigation.workgroups'), foodcoop_workgroups_path subnav.item :ordergroups, I18n.t('navigation.ordergroups'), foodcoop_ordergroups_path subnav.item :tasks, I18n.t('navigation.tasks'), tasks_path @@ -21,31 +21,44 @@ SimpleNavigation::Configuration.run do |navigation| primary.item :orders, I18n.t('navigation.orders.title'), '#' do |subnav| subnav.item :ordering, I18n.t('navigation.orders.ordering'), group_orders_path subnav.item :ordering_archive, I18n.t('navigation.orders.archive'), archive_group_orders_path - subnav.item :orders, I18n.t('navigation.orders.manage'), orders_path, if: Proc.new { current_user.role_orders? } - subnav.item :pickups, I18n.t('navigation.orders.pickups'), pickups_path, if: Proc.new { current_user.role_pickups? } + subnav.item :orders, I18n.t('navigation.orders.manage'), orders_path, if: proc { current_user.role_orders? } + subnav.item :pickups, I18n.t('navigation.orders.pickups'), pickups_path, if: proc { + current_user.role_pickups? + } end primary.item :articles, I18n.t('navigation.articles.title'), '#', - if: Proc.new { current_user.role_article_meta? or current_user.role_suppliers? } do |subnav| + if: proc { current_user.role_article_meta? or current_user.role_suppliers? } do |subnav| subnav.item :suppliers, I18n.t('navigation.articles.suppliers'), suppliers_path subnav.item :stockit, I18n.t('navigation.articles.stock'), stock_articles_path subnav.item :categories, I18n.t('navigation.articles.categories'), article_categories_path end - primary.item :finance, I18n.t('navigation.finances.title'), '#', if: Proc.new { current_user.role_finance? || current_user.role_invoices? } do |subnav| - subnav.item :finance_home, I18n.t('navigation.finances.home'), finance_root_path, if: Proc.new { current_user.role_finance? } - subnav.item :finance_home, I18n.t('navigation.finances.bank_accounts'), finance_bank_accounts_path, if: Proc.new { current_user.role_finance? } - subnav.item :accounts, I18n.t('navigation.finances.accounts'), finance_ordergroups_path, if: Proc.new { current_user.role_finance? } - subnav.item :balancing, I18n.t('navigation.finances.balancing'), finance_order_index_path, if: Proc.new { current_user.role_finance? } + primary.item :finance, I18n.t('navigation.finances.title'), '#', if: proc { + current_user.role_finance? || current_user.role_invoices? + } do |subnav| + subnav.item :finance_home, I18n.t('navigation.finances.home'), finance_root_path, if: proc { + current_user.role_finance? + } + subnav.item :finance_home, I18n.t('navigation.finances.bank_accounts'), finance_bank_accounts_path, if: proc { + current_user.role_finance? + } + subnav.item :accounts, I18n.t('navigation.finances.accounts'), finance_ordergroups_path, if: proc { + current_user.role_finance? + } + subnav.item :balancing, I18n.t('navigation.finances.balancing'), finance_order_index_path, if: proc { + current_user.role_finance? + } subnav.item :invoices, I18n.t('navigation.finances.invoices'), finance_invoices_path end - primary.item :admin, I18n.t('navigation.admin.title'), '#', if: Proc.new { current_user.role_admin? } do |subnav| + primary.item :admin, I18n.t('navigation.admin.title'), '#', if: proc { current_user.role_admin? } do |subnav| subnav.item :admin_home, I18n.t('navigation.admin.home'), admin_root_path subnav.item :users, I18n.t('navigation.admin.users'), admin_users_path subnav.item :ordergroups, I18n.t('navigation.admin.ordergroups'), admin_ordergroups_path subnav.item :workgroups, I18n.t('navigation.admin.workgroups'), admin_workgroups_path - subnav.item :mail_delivery_status, I18n.t('navigation.admin.mail_delivery_status'), admin_mail_delivery_status_index_path + subnav.item :mail_delivery_status, I18n.t('navigation.admin.mail_delivery_status'), + admin_mail_delivery_status_index_path subnav.item :finances, I18n.t('navigation.admin.finance'), admin_finances_path subnav.item :config, I18n.t('navigation.admin.config'), admin_config_path end diff --git a/config/puma.rb b/config/puma.rb index 4f4fd1cf..609df0ad 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -4,19 +4,19 @@ # the maximum value specified for Puma. Default is set to 5 threads for minimum # and maximum; this matches the default thread size of Active Record. # -threads_count = ENV.fetch("RAILS_MAX_THREADS") { 1 } +threads_count = ENV.fetch('RAILS_MAX_THREADS') { 1 } threads threads_count, threads_count # Specifies the `port` that Puma will listen on to receive requests; default is 3000. # -port ENV.fetch("PORT") { 3000 } +port ENV.fetch('PORT') { 3000 } # Bind automatically to all systemd activated sockets bind_to_activated_sockets # Specifies the `environment` that Puma will run in. # -environment ENV.fetch("RAILS_ENV") { "development" } +environment ENV.fetch('RAILS_ENV') { 'development' } # Specifies the number of `workers` to boot in clustered mode. # Workers are forked webserver processes. If using threads and workers together @@ -24,7 +24,7 @@ environment ENV.fetch("RAILS_ENV") { "development" } # Workers do not work on JRuby or Windows (both of which do not support # processes). # -workers ENV.fetch("WEB_CONCURRENCY") { 8 } +workers ENV.fetch('WEB_CONCURRENCY') { 8 } # Use the `preload_app!` method when specifying a `workers` number. # This directive tells Puma to first boot the application and load code diff --git a/config/routes.rb b/config/routes.rb index b82699ec..8fea34b0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,11 +1,12 @@ +# rubocop:disable Metrics/BlockLength 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' - get "sessions/new" + get 'sessions/new' root to: 'sessions#redirect_to_foodcoop', as: nil @@ -23,8 +24,8 @@ Rails.application.routes.draw do post '/login/reset_password' => 'login#reset_password', as: :reset_password get '/login/new_password' => 'login#new_password', as: :new_password patch '/login/update_password' => 'login#update_password', as: :update_password - match '/login/accept_invitation/:token' => 'login#accept_invitation', as: :accept_invitation, via: [:get, :post] - resources :sessions, only: [:new, :create, :destroy] + match '/login/accept_invitation/:token' => 'login#accept_invitation', as: :accept_invitation, via: %i[get post] + resources :sessions, only: %i[new create destroy] get '/foodcoop.css' => 'styles#foodcoop', as: 'foodcoop_css' @@ -47,7 +48,6 @@ Rails.application.routes.draw do get :receive post :receive - get :custom_csv get :receive_on_order_article_create get :receive_on_order_article_update end @@ -65,11 +65,11 @@ Rails.application.routes.draw do resources :group_order_articles - resources :order_comments, only: [:new, :create] + resources :order_comments, only: %i[new create] ############ Foodcoop orga - resources :invites, only: [:new, :create] + resources :invites, only: %i[new create] resources :tasks do collection do @@ -91,7 +91,7 @@ Rails.application.routes.draw do resources :ordergroups, only: [:index] - resources :workgroups, only: [:index, :edit, :update] + resources :workgroups, only: %i[index edit update] end ########### Article management @@ -175,7 +175,7 @@ Rails.application.routes.draw do get :unpaid, on: :collection end - resources :links, controller: 'financial_links', only: [:create, :show] do + resources :links, controller: 'financial_links', only: %i[create show] do collection do get :incomplete end @@ -185,8 +185,10 @@ Rails.application.routes.draw do delete 'bank_transactions/:bank_transaction', action: 'remove_bank_transaction', as: 'remove_bank_transaction' get :index_financial_transaction - put 'financial_transactions/:financial_transaction', action: 'add_financial_transaction', as: 'add_financial_transaction' - delete 'financial_transactions/:financial_transaction', action: 'remove_financial_transaction', as: 'remove_financial_transaction' + put 'financial_transactions/:financial_transaction', action: 'add_financial_transaction', + as: 'add_financial_transaction' + delete 'financial_transactions/:financial_transaction', action: 'remove_financial_transaction', + as: 'remove_financial_transaction' get :index_invoice put 'invoices/:invoice', action: 'add_invoice', as: 'add_invoice' @@ -200,12 +202,14 @@ Rails.application.routes.draw do resources :ordergroups, only: [:index] do resources :financial_transactions, as: :transactions end - resources :financial_transactions, as: :foodcoop_financial_transactions, path: 'foodcoop/financial_transactions', only: [:index, :new, :create] + resources :financial_transactions, as: :foodcoop_financial_transactions, path: 'foodcoop/financial_transactions', + only: %i[index new create] get :transactions, controller: :financial_transactions, action: :index_collection delete 'transactions/:id', controller: :financial_transactions, action: :destroy, as: :transaction get 'transactions/new_collection' => 'financial_transactions#new_collection', as: 'new_transaction_collection' - post 'transactions/create_collection' => 'financial_transactions#create_collection', as: 'create_transaction_collection' + post 'transactions/create_collection' => 'financial_transactions#create_collection', + as: 'create_transaction_collection' resources :bank_accounts, only: [:index] do member do @@ -217,7 +221,7 @@ Rails.application.routes.draw do resources :bank_transactions, as: :transactions end - resources :bank_transactions, only: [:index, :show] + resources :bank_transactions, only: %i[index show] end ########### Administration @@ -251,11 +255,11 @@ Rails.application.routes.draw do get :memberships, on: :member end - resources :mail_delivery_status, only: [:index, :show, :destroy] do + resources :mail_delivery_status, only: %i[index show destroy] do delete :index, on: :collection, action: :destroy_all end - resource :config, only: [:show, :update] do + resource :config, only: %i[show update] do get :list end end @@ -270,26 +274,27 @@ Rails.application.routes.draw do namespace :user do root to: 'users#show' get :financial_overview, to: 'ordergroup#financial_overview' - resources :financial_transactions, only: [:index, :show, :create] + resources :financial_transactions, only: %i[index show create] resources :group_order_articles end - resources :financial_transaction_classes, only: [:index, :show] - resources :financial_transaction_types, only: [:index, :show] - resources :financial_transactions, only: [:index, :show] - resources :orders, only: [:index, :show] - resources :order_articles, only: [:index, :show] + resources :financial_transaction_classes, only: %i[index show] + resources :financial_transaction_types, only: %i[index show] + resources :financial_transactions, only: %i[index show] + resources :orders, only: %i[index show] + resources :order_articles, only: %i[index show] resources :group_order_articles - resources :article_categories, only: [:index, :show] + resources :article_categories, only: %i[index show] end end ############## Feedback - resource :feedback, only: [:new, :create], controller: 'feedback' + resource :feedback, only: %i[new create], controller: 'feedback' ############## The rest resources :users, only: [:index] end # End of /:foodcoop scope end +# rubocop:enable Metrics/BlockLength diff --git a/config/schedule.rb b/config/schedule.rb index f22c1348..6d424324 100644 --- a/config/schedule.rb +++ b/config/schedule.rb @@ -2,22 +2,23 @@ # Learn more: http://github.com/javan/whenever # Upcoming tasks notifier -every :day, :at => '7:20 am' do - rake "multicoops:run TASK=foodsoft:notify_upcoming_tasks" - rake "multicoops:run TASK=foodsoft:notify_users_of_weekly_task" +every :day, at: '7:20 am' do + rake 'multicoops:run TASK=foodsoft:notify_upcoming_tasks' + rake 'multicoops:run TASK=foodsoft:notify_users_of_weekly_task' end # Import and assign bank transactions -every :weekday, :at => %w(5:56am 6:04pm) do - rake "multicoops:run TASK=foodsoft:import_and_assign_bank_transactions" +every :weekday, at: %w[5:56am 6:04pm] do + rake 'multicoops:run TASK=foodsoft:import_and_assign_bank_transactions' end -# Weekly taks -every :sunday, :at => '7:14 am' do - rake "multicoops:run TASK=foodsoft:create_upcoming_periodic_tasks" +# Weekly tasks +every :sunday, at: '7:14 am' do + rake 'multicoops:run TASK=foodsoft:create_upcoming_periodic_tasks' + rake 'multicoops:run TASKS=foodsoft:prune_old_attachments' end # Finish ended orders every 1.minute do - rake "multicoops:run TASK=foodsoft:finish_ended_orders" + rake 'multicoops:run TASK=foodsoft:finish_ended_orders' end diff --git a/config/spring.rb b/config/spring.rb index c9119b40..9fa7863f 100644 --- a/config/spring.rb +++ b/config/spring.rb @@ -1,6 +1,6 @@ -%w( +%w[ .ruby-version .rbenv-vars tmp/restart.txt tmp/caching-dev.txt -).each { |path| Spring.watch(path) } +].each { |path| Spring.watch(path) } diff --git a/crowdin.yml b/crowdin.yml index 5e81eec5..f939ea23 100644 --- a/crowdin.yml +++ b/crowdin.yml @@ -1,5 +1,7 @@ project_id: 357447 api_token_env: CROWDIN_API_KEY +preserve_hierarchy: true +base_path: "." files: - source: /config/locales/en.yml translation: /config/locales/%two_letters_code%.yml diff --git a/db/migrate/001_create_users.rb b/db/migrate/001_create_users.rb index ab4a560a..e530bdbf 100644 --- a/db/migrate/001_create_users.rb +++ b/db/migrate/001_create_users.rb @@ -4,30 +4,31 @@ class CreateUsers < ActiveRecord::Migration[4.2] def self.up create_table :users do |t| - t.column :nick, :string, :null => false - t.column :password_hash, :string, :null => false - t.column :password_salt, :string, :null => false - t.column :first_name, :string, :null => false - t.column :last_name, :string, :null => false - t.column :email, :string, :null => false + t.column :nick, :string, null: false + t.column :password_hash, :string, null: false + t.column :password_salt, :string, null: false + t.column :first_name, :string, null: false + t.column :last_name, :string, null: false + t.column :email, :string, null: false t.column :phone, :string t.column :address, :string - t.column :created_on, :timestamp, :null => false + t.column :created_on, :timestamp, null: false end - add_index(:users, :nick, :unique => true) - add_index(:users, :email, :unique => true) + add_index(:users, :nick, unique: true) + add_index(:users, :email, unique: true) # Create the default admin user... puts "Creating user #{USER_ADMIN} with password 'secret'..." - user = User.new(:nick => USER_ADMIN, :first_name => "Anton", :last_name => "Administrator", :email => "admin@foo.test") - user.password = "secret" - raise "Failed!" unless user.save && User.find_by_nick(USER_ADMIN).has_password("secret") + user = User.new(nick: USER_ADMIN, first_name: 'Anton', last_name: 'Administrator', + email: 'admin@foo.test') + user.password = 'secret' + raise 'Failed!' unless user.save && User.find_by_nick(USER_ADMIN).has_password('secret') # Create a normal user... puts "Creating user #{USER_TEST} with password 'foobar'..." - user = User.new(:nick => USER_TEST, :first_name => "Tim", :last_name => "Tester", :email => "test@foo.test") - user.password = "foobar" - raise "Failed!" unless user.save && User.find_by_nick(USER_TEST).has_password("foobar") + user = User.new(nick: USER_TEST, first_name: 'Tim', last_name: 'Tester', email: 'test@foo.test') + user.password = 'foobar' + raise 'Failed!' unless user.save && User.find_by_nick(USER_TEST).has_password('foobar') end def self.down diff --git a/db/migrate/002_create_groups.rb b/db/migrate/002_create_groups.rb index bb7427b9..31104a1e 100644 --- a/db/migrate/002_create_groups.rb +++ b/db/migrate/002_create_groups.rb @@ -4,47 +4,48 @@ class CreateGroups < ActiveRecord::Migration[4.2] def self.up create_table :groups do |t| - t.column :type, :string, :null => false # inheritance, types: Group, OrderGroup - t.column :name, :string, :null => false + t.column :type, :string, null: false # inheritance, types: Group, OrderGroup + t.column :name, :string, null: false t.column :description, :string t.column :actual_size, :integer # OrderGroup column - t.column :account_balance, :decimal, :precision => 8, :scale => 2, :null => false, :default => 0 # OrderGroup column + t.column :account_balance, :decimal, precision: 8, scale: 2, null: false, default: 0 # OrderGroup column t.column :account_updated, :timestamp # OrderGroup column - t.column :created_on, :timestamp, :null => false - t.column :role_admin, :boolean, :default => false, :null => false + t.column :created_on, :timestamp, null: false + t.column :role_admin, :boolean, default: false, null: false end - add_index(:groups, :name, :unique => true) + add_index(:groups, :name, unique: true) create_table :memberships do |t| - t.column :group_id, :integer, :null => false - t.column :user_id, :integer, :null => false + t.column :group_id, :integer, null: false + t.column :user_id, :integer, null: false end - add_index(:memberships, [:user_id, :group_id], :unique => true) + add_index(:memberships, %i[user_id group_id], unique: true) # Create the default "Administrators" group... puts "Creating group #{GROUP_ADMIN}..." - Group.create(:name => GROUP_ADMIN, :description => "System administrators.", :role_admin => true) + Group.create(name: GROUP_ADMIN, description: 'System administrators.', role_admin: true) raise 'Failed!' unless administrators = Group.find_by_name(GROUP_ADMIN) # Create a sample order group... puts "Creating order group #{GROUP_ORDER}..." - ordergroup = OrderGroup.create!(:name => GROUP_ORDER, :description => "A sample order group created by the migration.", :actual_size => 1, :account_updated => Time.now) - raise "Wrong type created!" unless ordergroup.is_a?(OrderGroup) + ordergroup = OrderGroup.create!(name: GROUP_ORDER, + description: 'A sample order group created by the migration.', actual_size: 1, account_updated: Time.now) + raise 'Wrong type created!' unless ordergroup.is_a?(OrderGroup) # Get the admin user and join the admin group... raise "User #{CreateUsers::USER_ADMIN} not found, cannot join group '#{administrators.name}'!" unless admin = User.find_by_nick(CreateUsers::USER_ADMIN) puts "Joining #{CreateUsers::USER_ADMIN} user to new '#{administrators.name}' group as a group admin..." - membership = Membership.create(:group => administrators, :user => admin) - raise "Failed!" unless admin.memberships.first == membership + membership = Membership.create(group: administrators, user: admin) + raise 'Failed!' unless admin.memberships.first == membership raise "User #{CreateUsers::USER_ADMIN} has no admin_roles" unless admin.role_admin? # Get the test user and join the order group... raise "User #{CreateUsers::USER_TEST} not found, cannot join group '#{ordergroup.name}'!" unless test = User.find_by_nick(CreateUsers::USER_TEST) puts "Joining #{CreateUsers::USER_TEST} user to new '#{ordergroup.name}' group as a group admin..." - membership = Membership.create(:group => ordergroup, :user => test) - raise "Failed!" unless test.memberships.first == membership + membership = Membership.create(group: ordergroup, user: test) + raise 'Failed!' unless test.memberships.first == membership end def self.down diff --git a/db/migrate/003_create_suppliers.rb b/db/migrate/003_create_suppliers.rb index 2b38c9c1..72e148b8 100644 --- a/db/migrate/003_create_suppliers.rb +++ b/db/migrate/003_create_suppliers.rb @@ -2,17 +2,17 @@ class CreateSuppliers < ActiveRecord::Migration[4.2] SUPPLIER_SAMPLE = 'Sample Supplier' def self.up - add_column :groups, :role_suppliers, :boolean, :default => false, :null => false + add_column :groups, :role_suppliers, :boolean, default: false, null: false Group.reset_column_information puts "Give #{CreateGroups::GROUP_ADMIN} the role supplier .." - raise "Failed" unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_suppliers, true) - raise "Cannot find admin user!" unless admin = User.find_by_nick(CreateUsers::USER_ADMIN) - raise "Failed to enable role_suppliers with admin user!" unless admin.role_suppliers? + raise 'Failed' unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_suppliers, true) + raise 'Cannot find admin user!' unless admin = User.find_by_nick(CreateUsers::USER_ADMIN) + raise 'Failed to enable role_suppliers with admin user!' unless admin.role_suppliers? create_table :suppliers do |t| - t.column :name, :string, :null => false - t.column :address, :string, :null => false - t.column :phone, :string, :null => false + t.column :name, :string, null: false + t.column :address, :string, null: false + t.column :phone, :string, null: false t.column :phone2, :string t.column :fax, :string t.column :email, :string @@ -23,12 +23,12 @@ class CreateSuppliers < ActiveRecord::Migration[4.2] t.column :order_howto, :string t.column :note, :string end - add_index(:suppliers, :name, :unique => true) + add_index(:suppliers, :name, unique: true) # Create sample supplier... puts "Creating sample supplier '#{SUPPLIER_SAMPLE}'..." - Supplier.create(:name => SUPPLIER_SAMPLE, :address => "Organic City", :phone => "0123-555555") - raise "Failed!" unless supplier = Supplier.find_by_name(SUPPLIER_SAMPLE) + Supplier.create(name: SUPPLIER_SAMPLE, address: 'Organic City', phone: '0123-555555') + raise 'Failed!' unless supplier = Supplier.find_by_name(SUPPLIER_SAMPLE) end def self.down diff --git a/db/migrate/004_create_article_meta.rb b/db/migrate/004_create_article_meta.rb index eb81f550..36c22f65 100644 --- a/db/migrate/004_create_article_meta.rb +++ b/db/migrate/004_create_article_meta.rb @@ -5,24 +5,24 @@ class CreateArticleMeta < ActiveRecord::Migration[4.2] def self.up # Add user roles... - add_column :groups, :role_article_meta, :boolean, :default => false, :null => false + add_column :groups, :role_article_meta, :boolean, default: false, null: false Group.reset_column_information puts "Give #{CreateGroups::GROUP_ADMIN} the role article_meta .." - raise "Failed" unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_article_meta, true) + raise 'Failed' unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_article_meta, true) raise 'Cannot find admin user!' unless admin = User.find_by_nick(CreateUsers::USER_ADMIN) raise 'Failed to enable role_article_meta with admin user!' unless admin.role_article_meta? # ArticleCategories create_table :article_categories do |t| - t.column :name, :string, :null => false + t.column :name, :string, null: false t.column :description, :string end - add_index(:article_categories, :name, :unique => true) + add_index(:article_categories, :name, unique: true) # Create sample category... puts "Creating sample article category '#{CATEGORY_SAMPLE}'..." - ArticleCategory.create(:name => CATEGORY_SAMPLE, :description => "This is just a sample article category.") - raise "Failed!" unless category = ArticleCategory.find_by_name(CATEGORY_SAMPLE) + ArticleCategory.create(name: CATEGORY_SAMPLE, description: 'This is just a sample article category.') + raise 'Failed!' unless category = ArticleCategory.find_by_name(CATEGORY_SAMPLE) end def self.down diff --git a/db/migrate/005_create_financial_transactions.rb b/db/migrate/005_create_financial_transactions.rb index 0b1cef89..7ca0e83c 100644 --- a/db/migrate/005_create_financial_transactions.rb +++ b/db/migrate/005_create_financial_transactions.rb @@ -2,19 +2,19 @@ class CreateFinancialTransactions < ActiveRecord::Migration[4.2] def self.up # Create Financial Transactions create_table :financial_transactions do |t| - t.column :order_group_id, :integer, :null => false - t.column :amount, :decimal, :precision => 8, :scale => 2, :null => false - t.column :note, :text, :null => false - t.column :user_id, :integer, :null => false - t.column :created_on, :datetime, :null => false + t.column :order_group_id, :integer, null: false + t.column :amount, :decimal, precision: 8, scale: 2, null: false + t.column :note, :text, null: false + t.column :user_id, :integer, null: false + t.column :created_on, :datetime, null: false end # add column for the finance role puts 'add column in "groups" for the finance role' - add_column :groups, :role_finance, :boolean, :default => false, :null => false + add_column :groups, :role_finance, :boolean, default: false, null: false Group.reset_column_information puts "Give #{CreateGroups::GROUP_ADMIN} the role finance .." - raise "Failed" unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_finance, true) + raise 'Failed' unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_finance, true) raise 'Cannot find admin user!' unless admin = User.find_by_nick(CreateUsers::USER_ADMIN) raise 'Failed to enable role_finance with admin user!' unless admin.role_finance? @@ -27,8 +27,8 @@ class CreateFinancialTransactions < ActiveRecord::Migration[4.2] ordergroup.addFinancialTransaction(i, "Sample Transaction Nr. #{i}", admin) balance += i end - raise "Failed!" unless financial_transaction = FinancialTransaction.find_by_note('Sample Transaction Nr. 1') - raise "Failed to update account_balance!" unless OrderGroup.find(ordergroup.id).account_balance == balance + raise 'Failed!' unless financial_transaction = FinancialTransaction.find_by_note('Sample Transaction Nr. 1') + raise 'Failed to update account_balance!' unless OrderGroup.find(ordergroup.id).account_balance == balance end def self.down diff --git a/db/migrate/006_create_articles.rb b/db/migrate/006_create_articles.rb index 9a43c8dc..fd11e659 100644 --- a/db/migrate/006_create_articles.rb +++ b/db/migrate/006_create_articles.rb @@ -1,17 +1,17 @@ class CreateArticles < ActiveRecord::Migration[4.2] - SAMPLE_ARTICLE_NAMES = ['banana', 'kiwi', 'strawberry'] + SAMPLE_ARTICLE_NAMES = %w[banana kiwi strawberry] def self.up create_table :articles do |t| - t.column :name, :string, :null => false - t.column :supplier_id, :integer, :null => false - t.column :article_category_id, :integer, :null => false - t.column :unit, :string, :null => false + t.column :name, :string, null: false + t.column :supplier_id, :integer, null: false + t.column :article_category_id, :integer, null: false + t.column :unit, :string, null: false t.column :note, :string - t.column :availability, :boolean, :default => true, :null => false + t.column :availability, :boolean, default: true, null: false t.column :current_price_id, :integer end - add_index(:articles, :name, :unique => true) + add_index(:articles, :name, unique: true) # Create 30 sample articles... puts "Create 3 articles of the supplier '#{CreateSuppliers::SUPPLIER_SAMPLE}'..." @@ -20,14 +20,14 @@ class CreateArticles < ActiveRecord::Migration[4.2] SAMPLE_ARTICLE_NAMES.each do |a| puts 'Create Article ' + a - Article.create(:name => a, - :supplier => supplier, - :article_category => category, - :unit => '500g', - :note => 'delicious', - :availability => true) + Article.create(name: a, + supplier: supplier, + article_category: category, + unit: '500g', + note: 'delicious', + availability: true) end - raise "Failed!" unless Article.find(:all).length == SAMPLE_ARTICLE_NAMES.length + raise 'Failed!' unless Article.find(:all).length == SAMPLE_ARTICLE_NAMES.length end def self.down diff --git a/db/migrate/007_create_article_prices.rb b/db/migrate/007_create_article_prices.rb index ed5b0793..56167a1a 100644 --- a/db/migrate/007_create_article_prices.rb +++ b/db/migrate/007_create_article_prices.rb @@ -1,13 +1,13 @@ class CreateArticlePrices < ActiveRecord::Migration[4.2] def self.up create_table :article_prices do |t| - t.column :article_id, :int, :null => false - t.column :clear_price, :decimal, :precision => 8, :scale => 2, :null => false - t.column :gross_price, :decimal, :precision => 8, :scale => 2, :null => false # gross price, incl. vat, refund and price markup - t.column :tax, :float, :null => false, :default => 0 - t.column :refund, :decimal, :precision => 8, :scale => 2, :null => false, :default => 0 + t.column :article_id, :int, null: false + t.column :clear_price, :decimal, precision: 8, scale: 2, null: false + t.column :gross_price, :decimal, precision: 8, scale: 2, null: false # gross price, incl. vat, refund and price markup + t.column :tax, :float, null: false, default: 0 + t.column :refund, :decimal, precision: 8, scale: 2, null: false, default: 0 t.column :updated_on, :datetime - t.column :unit_quantity, :int, :default => 1, :null => false + t.column :unit_quantity, :int, default: 1, null: false t.column :order_number, :string end add_index(:article_prices, :article_id) @@ -18,11 +18,11 @@ class CreateArticlePrices < ActiveRecord::Migration[4.2] puts 'Create Price for article ' + a raise "article #{a} not found!" unless article = Article.find_by_name(a) - new_price = ArticlePrice.new(:clear_price => rand(4) + 1, - :tax => 7.0, - :refund => 0, - :unit_quantity => rand(10) + 1, - :order_number => rand(9999)) + new_price = ArticlePrice.new(clear_price: rand(1..4), + tax: 7.0, + refund: 0, + unit_quantity: rand(1..10), + order_number: rand(9999)) article.add_price(new_price) raise 'Failed!' unless ArticlePrice.find_by_article_id(article.id) end diff --git a/db/migrate/008_create_orders.rb b/db/migrate/008_create_orders.rb index 6eb8c921..4e138899 100644 --- a/db/migrate/008_create_orders.rb +++ b/db/migrate/008_create_orders.rb @@ -4,28 +4,28 @@ class CreateOrders < ActiveRecord::Migration[4.2] def self.up # Order role - add_column :groups, :role_orders, :boolean, :default => false, :null => false + add_column :groups, :role_orders, :boolean, default: false, null: false Group.reset_column_information puts "Give #{CreateGroups::GROUP_ADMIN} the role finance .." - raise "Failed" unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_orders, true) + raise 'Failed' unless Group.find_by_name(CreateGroups::GROUP_ADMIN).update_attribute(:role_orders, true) raise 'Cannot find admin user!' unless admin = User.find_by_nick(CreateUsers::USER_ADMIN) raise 'Failed to enable role_orders with admin user!' unless admin.role_orders? # Create the default "Order" group... puts 'Creating group "Orders"...' - Group.create(:name => GROUP_ORDER, :description => "working group for managing orders", :role_orders => true) - raise "Failed!" unless Group.find_by_name(GROUP_ORDER) + Group.create(name: GROUP_ORDER, description: 'working group for managing orders', role_orders: true) + raise 'Failed!' unless Group.find_by_name(GROUP_ORDER) # Order create_table :orders do |t| - t.column :name, :string, :null => false - t.column :supplier_id, :integer, :null => false - t.column :starts, :datetime, :null => false + t.column :name, :string, null: false + t.column :supplier_id, :integer, null: false + t.column :starts, :datetime, null: false t.column :ends, :datetime t.column :note, :string - t.column :finished, :boolean, :default => false, :null => false - t.column :booked, :boolean, :null => false, :default => false - t.column :lock_version, :integer, :null => false, :default => 0 + t.column :finished, :boolean, default: false, null: false + t.column :booked, :boolean, null: false, default: false + t.column :lock_version, :integer, null: false, default: 0 t.column :updated_by_user_id, :integer end add_index(:orders, :starts) @@ -35,74 +35,77 @@ class CreateOrders < ActiveRecord::Migration[4.2] puts "Creating order '#{ORDER_TEST}'..." raise "Supplier '#{CreateSuppliers::SUPPLIER_SAMPLE}' not found!" unless supplier = Supplier.find_by_name(CreateSuppliers::SUPPLIER_SAMPLE) - Order.create(:name => ORDER_TEST, :supplier => supplier, :starts => Time.now) + Order.create(name: ORDER_TEST, supplier: supplier, starts: Time.now) raise 'Creating test order failed!' unless order = Order.find_by_name(ORDER_TEST) # OrderArticle create_table :order_articles do |t| - t.column :order_id, :integer, :null => false - t.column :article_id, :integer, :null => false - t.column :quantity, :integer, :null => false, :default => 0 - t.column :tolerance, :integer, :null => false, :default => 0 - t.column :units_to_order, :integer, :null => false, :default => 0 - t.column :lock_version, :integer, :null => false, :default => 0 + t.column :order_id, :integer, null: false + t.column :article_id, :integer, null: false + t.column :quantity, :integer, null: false, default: 0 + t.column :tolerance, :integer, null: false, default: 0 + t.column :units_to_order, :integer, null: false, default: 0 + t.column :lock_version, :integer, null: false, default: 0 end - add_index(:order_articles, [:order_id, :article_id], :unique => true) + add_index(:order_articles, %i[order_id article_id], unique: true) puts 'Adding articles to the order...' - CreateArticles::SAMPLE_ARTICLE_NAMES.each { |a| + CreateArticles::SAMPLE_ARTICLE_NAMES.each do |a| puts "Article #{a}..." raise 'Article not found!' unless article = Article.find_by_name(a) raise 'No price found for article!' unless price = article.current_price - OrderArticle.create(:order => order, :article => article) + OrderArticle.create(order: order, article: article) raise 'Creating OrderArticle failed!' unless OrderArticle.find_by_order_id_and_article_id(order.id, article.id) - } + end raise 'Creating OrderArticles failed!' unless order.articles.size == CreateArticles::SAMPLE_ARTICLE_NAMES.length # GroupOrder create_table :group_orders do |t| - t.column :order_group_id, :integer, :null => false - t.column :order_id, :integer, :null => false - t.column :price, :decimal, :precision => 8, :scale => 2, :null => false, :default => 0 - t.column :lock_version, :integer, :null => false, :default => 0 - t.column :updated_on, :timestamp, :null => false - t.column :updated_by_user_id, :integer, :null => false + t.column :order_group_id, :integer, null: false + t.column :order_id, :integer, null: false + t.column :price, :decimal, precision: 8, scale: 2, null: false, default: 0 + t.column :lock_version, :integer, null: false, default: 0 + t.column :updated_on, :timestamp, null: false + t.column :updated_by_user_id, :integer, null: false end - add_index(:group_orders, [:order_group_id, :order_id], :unique => true) + add_index(:group_orders, %i[order_group_id order_id], unique: true) puts 'Adding group order...' raise "Cannot find user #{CreateUsers::USER_TEST}" unless user = User.find_by_nick(CreateUsers::USER_TEST) raise "Cannot find OrderGroup '#{CreateGroups::GROUP_ORDER}'!" unless orderGroup = OrderGroup.find_by_name(CreateGroups::GROUP_ORDER) - GroupOrder.create(:order_group => orderGroup, :order => order, :price => 0, :updated_by => user) - raise 'Retrieving group order failed!' unless groupOrder = orderGroup.group_orders.find(:first, :conditions => "order_id = #{order.id}") + GroupOrder.create(order_group: orderGroup, order: order, price: 0, updated_by: user) + raise 'Retrieving group order failed!' unless groupOrder = orderGroup.group_orders.find(:first, + conditions: "order_id = #{order.id}") # GroupOrderArticles create_table :group_order_articles do |t| - t.column :group_order_id, :integer, :null => false - t.column :order_article_id, :integer, :null => false - t.column :quantity, :integer, :null => false - t.column :tolerance, :integer, :null => false - t.column :updated_on, :timestamp, :null => false + t.column :group_order_id, :integer, null: false + t.column :order_article_id, :integer, null: false + t.column :quantity, :integer, null: false + t.column :tolerance, :integer, null: false + t.column :updated_on, :timestamp, null: false end - add_index(:group_order_articles, [:group_order_id, :order_article_id], :unique => true, :name => "goa_index") + add_index(:group_order_articles, %i[group_order_id order_article_id], unique: true, name: 'goa_index') # GroupOrderArticleQuantity create_table :group_order_article_quantities do |t| - t.column :group_order_article_id, :int, :null => false - t.column :quantity, :int, :default => 0 - t.column :tolerance, :int, :default => 0 - t.column :created_on, :timestamp, :null => false + t.column :group_order_article_id, :int, null: false + t.column :quantity, :int, default: 0 + t.column :tolerance, :int, default: 0 + t.column :created_on, :timestamp, null: false end puts 'Adding articles to group order...' - order.order_articles.each { |orderArticle| + order.order_articles.each do |orderArticle| puts "Article #{orderArticle.article.name}..." - GroupOrderArticle.create(:group_order => groupOrder, :order_article => orderArticle, :quantity => 0, :tolerance => 0) - raise 'Failed to create order!' unless article = GroupOrderArticle.find(:first, :conditions => "group_order_id = #{groupOrder.id} AND order_article_id = #{orderArticle.id}") + GroupOrderArticle.create(group_order: groupOrder, order_article: orderArticle, quantity: 0, + tolerance: 0) + raise 'Failed to create order!' unless article = GroupOrderArticle.find(:first, + conditions: "group_order_id = #{groupOrder.id} AND order_article_id = #{orderArticle.id}") - article.updateQuantities(rand(6) + 1, rand(4) + 1) - } + article.updateQuantities(rand(1..6), rand(1..4)) + end raise 'Failed to create orders!' unless groupOrder.order_articles.size == order.order_articles.size groupOrder.updatePrice diff --git a/db/migrate/009_create_order_results.rb b/db/migrate/009_create_order_results.rb index 20b75193..6b1cc65a 100644 --- a/db/migrate/009_create_order_results.rb +++ b/db/migrate/009_create_order_results.rb @@ -1,32 +1,32 @@ class CreateOrderResults < ActiveRecord::Migration[4.2] def self.up create_table :group_order_results do |t| - t.column :order_id, :int, :null => false - t.column :group_name, :string, :null => false - t.column :price, :decimal, :precision => 8, :scale => 2, :null => false, :default => 0 + t.column :order_id, :int, null: false + t.column :group_name, :string, null: false + t.column :price, :decimal, precision: 8, scale: 2, null: false, default: 0 end - add_index(:group_order_results, [:group_name, :order_id], :unique => true) + add_index(:group_order_results, %i[group_name order_id], unique: true) create_table :order_article_results do |t| - t.column :order_id, :int, :null => false - t.column :name, :string, :null => false - t.column :unit, :string, :null => false + t.column :order_id, :int, null: false + t.column :name, :string, null: false + t.column :unit, :string, null: false t.column :note, :string - t.column :clear_price, :decimal, :precision => 8, :scale => 2, :null => false - t.column :gross_price, :decimal, :precision => 8, :scale => 2, :null => false - t.column :tax, :float, :null => false, :default => 0 - t.column :refund, :decimal, :precision => 8, :scale => 2 - t.column :fc_markup, :float, :null => false + t.column :clear_price, :decimal, precision: 8, scale: 2, null: false + t.column :gross_price, :decimal, precision: 8, scale: 2, null: false + t.column :tax, :float, null: false, default: 0 + t.column :refund, :decimal, precision: 8, scale: 2 + t.column :fc_markup, :float, null: false t.column :order_number, :string - t.column :unit_quantity, :int, :null => false - t.column :units_to_order, :int, :null => false + t.column :unit_quantity, :int, null: false + t.column :units_to_order, :int, null: false end add_index(:order_article_results, :order_id) create_table :group_order_article_results do |t| - t.column :order_article_result_id, :int, :null => false - t.column :group_order_result_id, :int, :null => false - t.column :quantity, :int, :null => false + t.column :order_article_result_id, :int, null: false + t.column :group_order_result_id, :int, null: false + t.column :quantity, :int, null: false t.column :tolerance, :int end add_index(:group_order_article_results, :order_article_result_id) diff --git a/db/migrate/011_create_comments.rb b/db/migrate/011_create_comments.rb index 28fc0428..55148d08 100644 --- a/db/migrate/011_create_comments.rb +++ b/db/migrate/011_create_comments.rb @@ -1,16 +1,16 @@ class CreateComments < ActiveRecord::Migration[4.2] def self.up - create_table :comments, :force => true do |t| - t.column :title, :string, :limit => 50, :default => "" - t.column :comment, :string, :default => "" - t.column :created_at, :datetime, :null => false - t.column :commentable_id, :integer, :default => 0, :null => false - t.column :commentable_type, :string, :limit => 15, - :default => "", :null => false - t.column :user_id, :integer, :default => 0, :null => false + create_table :comments, force: true do |t| + t.column :title, :string, limit: 50, default: '' + t.column :comment, :string, default: '' + t.column :created_at, :datetime, null: false + t.column :commentable_id, :integer, default: 0, null: false + t.column :commentable_type, :string, limit: 15, + default: '', null: false + t.column :user_id, :integer, default: 0, null: false end - add_index :comments, ["user_id"], :name => "fk_comments_user" + add_index :comments, ['user_id'], name: 'fk_comments_user' end def self.down diff --git a/db/migrate/012_create_order_clearing.rb b/db/migrate/012_create_order_clearing.rb index 1d3133fd..9ddb4ad3 100644 --- a/db/migrate/012_create_order_clearing.rb +++ b/db/migrate/012_create_order_clearing.rb @@ -1,8 +1,8 @@ class CreateOrderClearing < ActiveRecord::Migration[4.2] def self.up - add_column :orders, :invoice_amount, :decimal, :precision => 8, :scale => 2, :null => false, :default => 0 - add_column :orders, :refund, :decimal, :precision => 8, :scale => 2, :null => false, :default => 0 - add_column :orders, :refund_credit, :decimal, :precision => 8, :scale => 2, :null => false, :default => 0 + add_column :orders, :invoice_amount, :decimal, precision: 8, scale: 2, null: false, default: 0 + add_column :orders, :refund, :decimal, precision: 8, scale: 2, null: false, default: 0 + add_column :orders, :refund_credit, :decimal, precision: 8, scale: 2, null: false, default: 0 add_column :orders, :invoice_number, :string add_column :orders, :invoice_date, :string end diff --git a/db/migrate/013_add_messaging.rb b/db/migrate/013_add_messaging.rb index 84ba8d6f..7f01b2dd 100644 --- a/db/migrate/013_add_messaging.rb +++ b/db/migrate/013_add_messaging.rb @@ -3,13 +3,13 @@ class AddMessaging < ActiveRecord::Migration[4.2] # Table that holds the messages: create_table :messages do |t| t.column :sender_id, :integer - t.column :recipient_id, :integer, :null => false - t.column :recipients, :string, :null => false - t.column :subject, :string, :null => false - t.column :body, :text, :null => false - t.column :read, :boolean, :null => false, :default => false - t.column :email_state, :integer, :null => false - t.column :created_on, :timestamp, :null => false + t.column :recipient_id, :integer, null: false + t.column :recipients, :string, null: false + t.column :subject, :string, null: false + t.column :body, :text, null: false + t.column :read, :boolean, null: false, default: false + t.column :email_state, :integer, null: false + t.column :created_on, :timestamp, null: false end add_index(:messages, :sender_id) add_index(:messages, :recipient_id) diff --git a/db/migrate/014_create_tasks.rb b/db/migrate/014_create_tasks.rb index db878546..8872523e 100644 --- a/db/migrate/014_create_tasks.rb +++ b/db/migrate/014_create_tasks.rb @@ -1,26 +1,26 @@ class CreateTasks < ActiveRecord::Migration[4.2] def self.up create_table :tasks do |t| - t.column :name, :string, :null => false + t.column :name, :string, null: false t.column :description, :string t.column :due_date, :date - t.column :done, :boolean, :default => false + t.column :done, :boolean, default: false t.column :group_id, :integer - t.column :assigned, :boolean, :default => false - t.column :created_on, :datetime, :null => false - t.column :updated_on, :datetime, :null => false + t.column :assigned, :boolean, default: false + t.column :created_on, :datetime, null: false + t.column :updated_on, :datetime, null: false end add_index :tasks, :name add_index :tasks, :due_date create_table :assignments do |t| - t.column :user_id, :integer, :null => false - t.column :task_id, :integer, :null => false - t.column :accepted, :boolean, :default => false + t.column :user_id, :integer, null: false + t.column :task_id, :integer, null: false + t.column :accepted, :boolean, default: false end - add_index :assignments, [:user_id, :task_id], :unique => true + add_index :assignments, %i[user_id task_id], unique: true - add_column :groups, :weekly_task, :boolean, :default => false # if group has an job for every week + add_column :groups, :weekly_task, :boolean, default: false # if group has an job for every week add_column :groups, :weekday, :integer # e.g. 1 means monday, 2 = tuesday an so on add_column :groups, :task_name, :string # the name of the weekly task add_column :groups, :task_description, :string diff --git a/db/migrate/015_change_result_quantities.rb b/db/migrate/015_change_result_quantities.rb index 23731334..56020eab 100644 --- a/db/migrate/015_change_result_quantities.rb +++ b/db/migrate/015_change_result_quantities.rb @@ -1,11 +1,11 @@ class ChangeResultQuantities < ActiveRecord::Migration[4.2] def self.up - change_column :group_order_article_results, :quantity, :decimal, :precision => 6, :scale => 3 - change_column :order_article_results, :units_to_order, :decimal, :precision => 6, :scale => 3, :null => false + change_column :group_order_article_results, :quantity, :decimal, precision: 6, scale: 3 + change_column :order_article_results, :units_to_order, :decimal, precision: 6, scale: 3, null: false end def self.down - change_column :group_order_article_results, :quantity, :integer, :null => false - change_column :order_article_results, :units_to_order, :integer, :default => 0, :null => false + change_column :group_order_article_results, :quantity, :integer, null: false + change_column :order_article_results, :units_to_order, :integer, default: 0, null: false end end diff --git a/db/migrate/018_create_invites.rb b/db/migrate/018_create_invites.rb index cc8a1ebc..49c3edf9 100644 --- a/db/migrate/018_create_invites.rb +++ b/db/migrate/018_create_invites.rb @@ -1,11 +1,11 @@ class CreateInvites < ActiveRecord::Migration[4.2] def self.up create_table :invites do |t| - t.column :token, :string, :null => false - t.column :expires_at, :timestamp, :null => false - t.column :group_id, :integer, :null => false - t.column :user_id, :integer, :null => false - t.column :email, :string, :null => false + t.column :token, :string, null: false + t.column :expires_at, :timestamp, null: false + t.column :group_id, :integer, null: false + t.column :user_id, :integer, null: false + t.column :email, :string, null: false end add_index :invites, :token end diff --git a/db/migrate/019_remove_uniqueness_of_article_name.rb b/db/migrate/019_remove_uniqueness_of_article_name.rb index 7504a66a..50170cb8 100644 --- a/db/migrate/019_remove_uniqueness_of_article_name.rb +++ b/db/migrate/019_remove_uniqueness_of_article_name.rb @@ -1,11 +1,11 @@ class RemoveUniquenessOfArticleName < ActiveRecord::Migration[4.2] def self.up remove_index :articles, :name - add_index :articles, [:name, :supplier_id] + add_index :articles, %i[name supplier_id] end def self.down - remove_index :articles, [:name, :supplier_id] - add_index :articles, :name, :unique => true + remove_index :articles, %i[name supplier_id] + add_index :articles, :name, unique: true end end diff --git a/db/migrate/021_remove_table_article_prices.rb b/db/migrate/021_remove_table_article_prices.rb index 7f172065..9b586fca 100644 --- a/db/migrate/021_remove_table_article_prices.rb +++ b/db/migrate/021_remove_table_article_prices.rb @@ -1,19 +1,19 @@ class RemoveTableArticlePrices < ActiveRecord::Migration[4.2] def self.up - puts "create columns in articles ..." - add_column "articles", "clear_price", :decimal, :precision => 8, :scale => 2, :default => 0.0, :null => false - add_column "articles", "gross_price", :decimal, :precision => 8, :scale => 2, :default => 0.0, :null => false - add_column "articles", "tax", :float - add_column "articles", "refund", :decimal, :precision => 8, :scale => 2, :default => 0.0, :null => false - add_column "articles", "unit_quantity", :integer, :default => 1, :null => false - add_column "articles", "order_number", :string - add_column "articles", "created_at", :datetime - add_column "articles", "updated_at", :datetime + puts 'create columns in articles ...' + add_column 'articles', 'clear_price', :decimal, precision: 8, scale: 2, default: 0.0, null: false + add_column 'articles', 'gross_price', :decimal, precision: 8, scale: 2, default: 0.0, null: false + add_column 'articles', 'tax', :float + add_column 'articles', 'refund', :decimal, precision: 8, scale: 2, default: 0.0, null: false + add_column 'articles', 'unit_quantity', :integer, default: 1, null: false + add_column 'articles', 'order_number', :string + add_column 'articles', 'created_at', :datetime + add_column 'articles', 'updated_at', :datetime # stop auto-updating the timestamps to make the data-copy safe! Article.record_timestamps = false - puts "now copy values of article_prices into new articles-columns..." + puts 'now copy values of article_prices into new articles-columns...' Article.find(:all).each do |article| price = article.current_price article.update!(clear_price: price.clear_price, @@ -26,46 +26,46 @@ class RemoveTableArticlePrices < ActiveRecord::Migration[4.2] created_at: price.updated_on) end - puts "delete article_prices, current_price attribute" + puts 'delete article_prices, current_price attribute' drop_table :article_prices remove_column :articles, :current_price_id end def self.down add_column :articles, :current_price_id, :integer - create_table "article_prices", :force => true do |t| - t.integer "article_id", :default => 0, :null => false - t.decimal "clear_price", :precision => 8, :scale => 2, :default => 0.0, :null => false - t.decimal "gross_price", :precision => 8, :scale => 2, :default => 0.0, :null => false - t.float "tax", :default => 0.0, :null => false - t.decimal "refund", :precision => 8, :scale => 2, :default => 0.0, :null => false - t.datetime "updated_on" - t.integer "unit_quantity", :default => 1, :null => false - t.string "order_number" + create_table 'article_prices', force: true do |t| + t.integer 'article_id', default: 0, null: false + t.decimal 'clear_price', precision: 8, scale: 2, default: 0.0, null: false + t.decimal 'gross_price', precision: 8, scale: 2, default: 0.0, null: false + t.float 'tax', default: 0.0, null: false + t.decimal 'refund', precision: 8, scale: 2, default: 0.0, null: false + t.datetime 'updated_on' + t.integer 'unit_quantity', default: 1, null: false + t.string 'order_number' end # copy data from article now into old ArticlePrice-object Article.find(:all).each do |article| - price = ArticlePrice.create(:clear_price => article.clear_price, - :gross_price => article.gross_price, - :tax => article.tax, - :refund => article.refund, - :unit_quantity => article.unit_quantity, - :order_number => article.order_number.blank? ? nil : article.order_number, - :updated_on => article.updated_at) + price = ArticlePrice.create(clear_price: article.clear_price, + gross_price: article.gross_price, + tax: article.tax, + refund: article.refund, + unit_quantity: article.unit_quantity, + order_number: article.order_number.presence, + updated_on: article.updated_at) article.update_attribute(:current_price, price) price.update_attribute(:article, article) end # remove new columns - remove_column "articles", "clear_price" - remove_column "articles", "gross_price" - remove_column "articles", "tax" - remove_column "articles", "refund" - remove_column "articles", "unit_quantity" - remove_column "articles", "order_number" - remove_column "articles", "created_at" - remove_column "articles", "updated_at" + remove_column 'articles', 'clear_price' + remove_column 'articles', 'gross_price' + remove_column 'articles', 'tax' + remove_column 'articles', 'refund' + remove_column 'articles', 'unit_quantity' + remove_column 'articles', 'order_number' + remove_column 'articles', 'created_at' + remove_column 'articles', 'updated_at' end end diff --git a/db/migrate/022_add_required_user_for_task.rb b/db/migrate/022_add_required_user_for_task.rb index 9e8d9621..105e1593 100644 --- a/db/migrate/022_add_required_user_for_task.rb +++ b/db/migrate/022_add_required_user_for_task.rb @@ -1,7 +1,7 @@ class AddRequiredUserForTask < ActiveRecord::Migration[4.2] def self.up - add_column :tasks, :required_users, :integer, :default => 1 - add_column :groups, :task_required_users, :integer, :default => 1 + add_column :tasks, :required_users, :integer, default: 1 + add_column :groups, :task_required_users, :integer, default: 1 # add default values to every task and group Task.find(:all).each { |task| task.update_attribute :required_users, 1 } Group.workgroups.each { |group| group.update_attribute :task_required_users, 1 } diff --git a/db/migrate/024_add_deposit_defaults.rb b/db/migrate/024_add_deposit_defaults.rb index ed9da063..68afdf5a 100644 --- a/db/migrate/024_add_deposit_defaults.rb +++ b/db/migrate/024_add_deposit_defaults.rb @@ -7,6 +7,5 @@ class AddDepositDefaults < ActiveRecord::Migration[4.2] change_column_default :orders, :deposit_credit, 0.0 end - def self.down - end + def self.down; end end diff --git a/db/migrate/025_extend_comments.rb b/db/migrate/025_extend_comments.rb index 662b92fd..3b1b1da2 100644 --- a/db/migrate/025_extend_comments.rb +++ b/db/migrate/025_extend_comments.rb @@ -1,9 +1,9 @@ class ExtendComments < ActiveRecord::Migration[4.2] def self.up - change_column :comments, :comment, :text, :default => "" + change_column :comments, :comment, :text, default: '' end def self.down - change_column :comments, :comment, :string, :default => "" + change_column :comments, :comment, :string, default: '' end end diff --git a/db/migrate/20090120184410_road_to_version_three.rb b/db/migrate/20090120184410_road_to_version_three.rb index 4bacff24..d271aee3 100644 --- a/db/migrate/20090120184410_road_to_version_three.rb +++ b/db/migrate/20090120184410_road_to_version_three.rb @@ -10,10 +10,10 @@ class RoadToVersionThree < ActiveRecord::Migration[4.2] create_table :messages do |t| t.references :sender t.text :recipients_ids - t.string :subject, :null => false + t.string :subject, null: false t.text :body - t.integer :email_state, :default => 0, :null => false - t.boolean :private, :default => false + t.integer :email_state, default: 0, null: false + t.boolean :private, default: false t.datetime :created_at end @@ -23,9 +23,9 @@ class RoadToVersionThree < ActiveRecord::Migration[4.2] add_column :groups, :deleted_at, :datetime # == Workgroups - puts "Migrate all groups to workgroups.." - Group.find(:all, :conditions => { :type => "" }).each do |workgroup| - workgroup.update_attribute(:type, "Workgroup") + puts 'Migrate all groups to workgroups..' + Group.find(:all, conditions: { type: '' }).each do |workgroup| + workgroup.update_attribute(:type, 'Workgroup') end # == Ordergroups @@ -34,11 +34,11 @@ class RoadToVersionThree < ActiveRecord::Migration[4.2] rename_column :financial_transactions, :order_group_id, :ordergroup_id rename_column :group_orders, :order_group_id, :ordergroup_id rename_column :tasks, :group_id, :workgroup_id - remove_index :group_orders, :name => "index_group_orders_on_order_group_id_and_order_id" - add_index :group_orders, [:ordergroup_id, :order_id], :unique => true + remove_index :group_orders, name: 'index_group_orders_on_order_group_id_and_order_id' + add_index :group_orders, %i[ordergroup_id order_id], unique: true - Group.find(:all, :conditions => { :type => "OrderGroup" }).each do |ordergroup| - ordergroup.update_attribute(:type, "Ordergroup") + Group.find(:all, conditions: { type: 'OrderGroup' }).each do |ordergroup| + ordergroup.update_attribute(:type, 'Ordergroup') end # move contact-infos from users to ordergroups add_column :groups, :contact_person, :string @@ -46,9 +46,7 @@ class RoadToVersionThree < ActiveRecord::Migration[4.2] add_column :groups, :contact_address, :string Ordergroup.all.each do |ordergroup| contact = ordergroup.users.first - if contact - ordergroup.update(contact_person: contact.name, contact_phone: contact.phone, contact_address: contact.address) - end + ordergroup.update(contact_person: contact.name, contact_phone: contact.phone, contact_address: contact.address) if contact end remove_column :users, :address @@ -57,15 +55,18 @@ class RoadToVersionThree < ActiveRecord::Migration[4.2] drop_table :group_order_results drop_table :order_article_results drop_table :group_order_article_results - GroupOrder.delete_all; OrderArticle.delete_all; GroupOrderArticle.delete_all; GroupOrderArticleQuantity.delete_all + GroupOrder.delete_all + OrderArticle.delete_all + GroupOrderArticle.delete_all + GroupOrderArticleQuantity.delete_all create_table :orders do |t| t.references :supplier t.text :note t.datetime :starts t.datetime :ends - t.string :state, :default => "open" # Statemachine ... open -> finished -> closed - t.integer :lock_version, :default => 0, :null => false + t.string :state, default: 'open' # Statemachine ... open -> finished -> closed + t.integer :lock_version, default: 0, null: false t.integer :updated_by_user_id end @@ -78,9 +79,9 @@ class RoadToVersionThree < ActiveRecord::Migration[4.2] t.date :date t.date :paid_on t.text :note - t.decimal :amount, :null => false, :precision => 8, :scale => 2, :default => 0.0 - 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 :amount, null: false, precision: 8, scale: 2, default: 0.0 + 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.timestamps end @@ -107,41 +108,41 @@ class RoadToVersionThree < ActiveRecord::Migration[4.2] # == ArticlePrice create_table :article_prices do |t| t.references :article - 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 :deposit, :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 :deposit, precision: 8, scale: 2, default: 0.0, null: false t.integer :unit_quantity t.datetime :created_at end # Create price history for every Article Article.all.each do |a| - a.article_prices.create :price => a.price, :tax => a.tax, - :deposit => a.deposit, :unit_quantity => a.unit_quantity + a.article_prices.create price: a.price, tax: a.tax, + deposit: a.deposit, unit_quantity: a.unit_quantity end # Every Article has now a Category. Fix it if neccessary. - Article.all(:conditions => { :article_category_id => nil }).each do |article| + Article.all(conditions: { article_category_id: nil }).each do |article| article.update_attribute(:article_category, ArticleCategory.first) end # order-articles add_column :order_articles, :article_price_id, :integer # == GroupOrder - change_column :group_orders, :updated_by_user_id, :integer, :default => nil, :null => true + change_column :group_orders, :updated_by_user_id, :integer, default: nil, null: true # == GroupOrderArticle # The total order result in ordergroup is now saved! - add_column :group_order_articles, :result, :integer, :default => nil + add_column :group_order_articles, :result, :integer, default: nil # == StockArticle add_column :articles, :type, :string - add_column :articles, :quantity, :integer, :default => 0 + add_column :articles, :quantity, :integer, default: 0 # == StockChanges create_table :stock_changes do |t| t.references :delivery t.references :order t.references :stock_article - t.integer :quantity, :default => 0 + t.integer :quantity, default: 0 t.datetime :created_at end @@ -158,6 +159,5 @@ class RoadToVersionThree < ActiveRecord::Migration[4.2] User.all.each { |u| u.settings['notify.upcoming_tasks'] = 1 } end - def self.down - end + def self.down; end end diff --git a/db/migrate/20090317175355_add_profit_to_orders.rb b/db/migrate/20090317175355_add_profit_to_orders.rb index 59f79609..78013f7d 100644 --- a/db/migrate/20090317175355_add_profit_to_orders.rb +++ b/db/migrate/20090317175355_add_profit_to_orders.rb @@ -1,6 +1,6 @@ class AddProfitToOrders < ActiveRecord::Migration[4.2] def self.up - add_column :orders, :foodcoop_result, :decimal, :precision => 8, :scale => 2 + add_column :orders, :foodcoop_result, :decimal, precision: 8, scale: 2 Order.closed.each do |order| order.update_attribute(:foodcoop_result, order.profit) diff --git a/db/migrate/20090325175756_create_pages.foodsoft_wiki_engine.rb b/db/migrate/20090325175756_create_pages.foodsoft_wiki_engine.rb index c5692f35..d2221013 100644 --- a/db/migrate/20090325175756_create_pages.foodsoft_wiki_engine.rb +++ b/db/migrate/20090325175756_create_pages.foodsoft_wiki_engine.rb @@ -5,7 +5,7 @@ class CreatePages < ActiveRecord::Migration[4.2] t.string :title t.text :body t.string :permalink - t.integer :lock_version, :default => 0 + t.integer :lock_version, default: 0 t.integer :updated_by t.integer :redirect t.integer :parent_id diff --git a/db/migrate/20090405131156_modify_group_order_article_result.rb b/db/migrate/20090405131156_modify_group_order_article_result.rb index 44e0dea8..b979422e 100644 --- a/db/migrate/20090405131156_modify_group_order_article_result.rb +++ b/db/migrate/20090405131156_modify_group_order_article_result.rb @@ -1,6 +1,6 @@ class ModifyGroupOrderArticleResult < ActiveRecord::Migration[4.2] def self.up - change_column :group_order_articles, :result, :decimal, :precision => 8, :scale => 3 + change_column :group_order_articles, :result, :decimal, precision: 8, scale: 3 end def self.down diff --git a/db/migrate/20090907120012_add_missing_indexes.rb b/db/migrate/20090907120012_add_missing_indexes.rb index 189b0417..93ea8771 100644 --- a/db/migrate/20090907120012_add_missing_indexes.rb +++ b/db/migrate/20090907120012_add_missing_indexes.rb @@ -1,35 +1,34 @@ class AddMissingIndexes < ActiveRecord::Migration[4.2] def self.up - add_index "article_prices", ["article_id"] + add_index 'article_prices', ['article_id'] - add_index "articles", ["supplier_id"] - add_index "articles", ["article_category_id"] - add_index "articles", ["type"] + add_index 'articles', ['supplier_id'] + add_index 'articles', ['article_category_id'] + add_index 'articles', ['type'] - add_index "deliveries", ["supplier_id"] + add_index 'deliveries', ['supplier_id'] - add_index "financial_transactions", ["ordergroup_id"] + add_index 'financial_transactions', ['ordergroup_id'] - add_index "group_order_article_quantities", ["group_order_article_id"] - add_index "group_orders", ["order_id"] - add_index "group_orders", ["ordergroup_id"] + add_index 'group_order_article_quantities', ['group_order_article_id'] + add_index 'group_orders', ['order_id'] + add_index 'group_orders', ['ordergroup_id'] - add_index "invoices", ["supplier_id"] - add_index "invoices", ["delivery_id"] + add_index 'invoices', ['supplier_id'] + add_index 'invoices', ['delivery_id'] - add_index "order_articles", ["order_id"] + add_index 'order_articles', ['order_id'] - add_index "order_comments", ["order_id"] + add_index 'order_comments', ['order_id'] - add_index "orders", ["state"] + add_index 'orders', ['state'] - add_index "stock_changes", ["delivery_id"] - add_index "stock_changes", ["stock_article_id"] - add_index "stock_changes", ["stock_taking_id"] + add_index 'stock_changes', ['delivery_id'] + add_index 'stock_changes', ['stock_article_id'] + add_index 'stock_changes', ['stock_taking_id'] - add_index "tasks", ["workgroup_id"] + add_index 'tasks', ['workgroup_id'] end - def self.down - end + def self.down; end end diff --git a/db/migrate/20110507184920_add_duration_to_tasks.rb b/db/migrate/20110507184920_add_duration_to_tasks.rb index 33a11494..86347508 100644 --- a/db/migrate/20110507184920_add_duration_to_tasks.rb +++ b/db/migrate/20110507184920_add_duration_to_tasks.rb @@ -1,6 +1,6 @@ class AddDurationToTasks < ActiveRecord::Migration[4.2] def self.up - add_column :tasks, :duration, :integer, :default => 1 + add_column :tasks, :duration, :integer, default: 1 end def self.down diff --git a/db/migrate/20110507192928_add_task_duration_to_workgroups.rb b/db/migrate/20110507192928_add_task_duration_to_workgroups.rb index c5b4844b..fd703d17 100644 --- a/db/migrate/20110507192928_add_task_duration_to_workgroups.rb +++ b/db/migrate/20110507192928_add_task_duration_to_workgroups.rb @@ -1,6 +1,6 @@ class AddTaskDurationToWorkgroups < ActiveRecord::Migration[4.2] def self.up - add_column :groups, :task_duration, :integer, :default => 1 + add_column :groups, :task_duration, :integer, default: 1 end def self.down diff --git a/db/migrate/20120622094337_add_next_weekly_tasks_number_to_workgroups.rb b/db/migrate/20120622094337_add_next_weekly_tasks_number_to_workgroups.rb index b8ac8c81..eeca92b3 100644 --- a/db/migrate/20120622094337_add_next_weekly_tasks_number_to_workgroups.rb +++ b/db/migrate/20120622094337_add_next_weekly_tasks_number_to_workgroups.rb @@ -1,6 +1,6 @@ class AddNextWeeklyTasksNumberToWorkgroups < ActiveRecord::Migration[4.2] def self.up - add_column :groups, :next_weekly_tasks_number, :integer, :default => 8 + add_column :groups, :next_weekly_tasks_number, :integer, default: 8 end def self.down diff --git a/db/migrate/20130622095040_move_weekly_tasks.rb b/db/migrate/20130622095040_move_weekly_tasks.rb index 3865a498..d57f3108 100644 --- a/db/migrate/20130622095040_move_weekly_tasks.rb +++ b/db/migrate/20130622095040_move_weekly_tasks.rb @@ -15,21 +15,21 @@ class MoveWeeklyTasks < ActiveRecord::Migration[4.2] def down PeriodicTaskGroup.all.each do |task_group| - unless task_group.tasks.empty? - task = task_group.tasks.first - workgroup = task.workgroup - puts "Writing task data of group #{task_group.id} to workgroup #{workgroup.name}" - workgroup_attributes = { - weekly_task: true, - weekday: task.due_date.days_to_week_start(:sunday), - task_name: task.name, - task_description: task.description, - task_required_users: task.required_users, - task_duration: task.duration - } - workgroup.update(workgroup_attributes) - task_group.tasks.update_all weekly: true - end + next if task_group.tasks.empty? + + task = task_group.tasks.first + workgroup = task.workgroup + puts "Writing task data of group #{task_group.id} to workgroup #{workgroup.name}" + workgroup_attributes = { + weekly_task: true, + weekday: task.due_date.days_to_week_start(:sunday), + task_name: task.name, + task_description: task.description, + task_required_users: task.required_users, + task_duration: task.duration + } + workgroup.update(workgroup_attributes) + task_group.tasks.update_all weekly: true end end diff --git a/db/migrate/20130702113610_update_group_order_totals.rb b/db/migrate/20130702113610_update_group_order_totals.rb index da57126a..52edbad4 100644 --- a/db/migrate/20130702113610_update_group_order_totals.rb +++ b/db/migrate/20130702113610_update_group_order_totals.rb @@ -1,18 +1,17 @@ class UpdateGroupOrderTotals < ActiveRecord::Migration[4.2] def self.up say "If you have ever modified an order after it was settled, the group_order's " + - "price may be calculated incorrectly. This can take a lot of time on a " + - "large database." + 'price may be calculated incorrectly. This can take a lot of time on a ' + + 'large database.' - say "If you do want to update the ordergroup totals, open the rails console " + - "(by running `rails c`), and enter:" + say 'If you do want to update the ordergroup totals, open the rails console ' + + '(by running `rails c`), and enter:' - say "GroupOrder.all.each { |go| go.order.closed? and go.update_price! }", subitem: true + say 'GroupOrder.all.each { |go| go.order.closed? and go.update_price! }', subitem: true - say "You may want to check first that no undesired accounting issues are introduced. " + - "It may be wise to discuss this with those responsible for the ordering finances." + say 'You may want to check first that no undesired accounting issues are introduced. ' + + 'It may be wise to discuss this with those responsible for the ordering finances.' end - def self.down - end + def self.down; end end diff --git a/db/migrate/20130718183100_create_settings.rb b/db/migrate/20130718183100_create_settings.rb index 9928a9b3..90639d71 100644 --- a/db/migrate/20130718183100_create_settings.rb +++ b/db/migrate/20130718183100_create_settings.rb @@ -8,7 +8,7 @@ class CreateSettings < ActiveRecord::Migration[4.2] t.timestamps end - add_index :settings, [:thing_type, :thing_id, :var], unique: true + add_index :settings, %i[thing_type thing_id var], unique: true end def self.down diff --git a/db/migrate/20130718183101_migrate_user_settings.rb b/db/migrate/20130718183101_migrate_user_settings.rb index 04cfaeb8..2d0e3c56 100644 --- a/db/migrate/20130718183101_migrate_user_settings.rb +++ b/db/migrate/20130718183101_migrate_user_settings.rb @@ -46,8 +46,7 @@ class MigrateUserSettings < ActiveRecord::Migration[4.2] drop_table :configurable_settings end - def down - end + def down; end end # this is the base class of all configurable settings diff --git a/db/migrate/20130920201529_allow_missing_nick.rb b/db/migrate/20130920201529_allow_missing_nick.rb index ed818860..fcf1d8c8 100644 --- a/db/migrate/20130920201529_allow_missing_nick.rb +++ b/db/migrate/20130920201529_allow_missing_nick.rb @@ -1,9 +1,9 @@ class AllowMissingNick < ActiveRecord::Migration[4.2] def self.up - change_column :users, :nick, :string, :default => nil, :null => true + change_column :users, :nick, :string, default: nil, null: true end def self.down - change_column :users, :nick, :string, :default => "", :null => false + change_column :users, :nick, :string, default: '', null: false end end diff --git a/db/migrate/20140102170431_add_result_computed_to_group_order_articles.rb b/db/migrate/20140102170431_add_result_computed_to_group_order_articles.rb index dd9fc407..0bb885d9 100644 --- a/db/migrate/20140102170431_add_result_computed_to_group_order_articles.rb +++ b/db/migrate/20140102170431_add_result_computed_to_group_order_articles.rb @@ -1,6 +1,6 @@ class AddResultComputedToGroupOrderArticles < ActiveRecord::Migration[4.2] def change add_column :group_order_articles, :result_computed, - :decimal, :precision => 8, :scale => 3 + :decimal, precision: 8, scale: 3 end end diff --git a/db/migrate/20140318173000_delete_empty_group_order_articles.rb b/db/migrate/20140318173000_delete_empty_group_order_articles.rb index 1e053c3c..c5b396ed 100644 --- a/db/migrate/20140318173000_delete_empty_group_order_articles.rb +++ b/db/migrate/20140318173000_delete_empty_group_order_articles.rb @@ -4,6 +4,5 @@ class DeleteEmptyGroupOrderArticles < ActiveRecord::Migration[4.2] GroupOrderArticle.where(quantity: 0, tolerance: 0, result: [0, nil], result_computed: [0, nil]).delete_all end - def down - end + def down; end end diff --git a/db/migrate/20140921104907_remove_stale_memberships.rb b/db/migrate/20140921104907_remove_stale_memberships.rb index de5b719b..26b6c834 100644 --- a/db/migrate/20140921104907_remove_stale_memberships.rb +++ b/db/migrate/20140921104907_remove_stale_memberships.rb @@ -1,5 +1,5 @@ class RemoveStaleMemberships < ActiveRecord::Migration[4.2] def up - Membership.where("group_id NOT IN (?)", Group.ids).delete_all + Membership.where.not(group_id: Group.ids).delete_all end end diff --git a/db/migrate/20160217194036_add_role_invoices_to_group.rb b/db/migrate/20160217194036_add_role_invoices_to_group.rb index 6946fe05..5a86f425 100644 --- a/db/migrate/20160217194036_add_role_invoices_to_group.rb +++ b/db/migrate/20160217194036_add_role_invoices_to_group.rb @@ -1,5 +1,5 @@ class AddRoleInvoicesToGroup < ActiveRecord::Migration[4.2] def change - add_column :groups, :role_invoices, :boolean, :default => false, :null => false + add_column :groups, :role_invoices, :boolean, default: false, null: false end end diff --git a/db/migrate/20160218151041_add_attachment_to_invoice.rb b/db/migrate/20160218151041_add_attachment_to_invoice.rb index 58bac66d..1767905c 100644 --- a/db/migrate/20160218151041_add_attachment_to_invoice.rb +++ b/db/migrate/20160218151041_add_attachment_to_invoice.rb @@ -1,6 +1,6 @@ class AddAttachmentToInvoice < ActiveRecord::Migration[4.2] def change add_column :invoices, :attachment_mime, :string - add_column :invoices, :attachment_data, :binary, :limit => 8.megabyte + add_column :invoices, :attachment_data, :binary, limit: 8.megabyte end end diff --git a/db/migrate/20160219123220_create_financial_transaction_class_and_types.rb b/db/migrate/20160219123220_create_financial_transaction_class_and_types.rb index 5fcf318b..3c05035d 100644 --- a/db/migrate/20160219123220_create_financial_transaction_class_and_types.rb +++ b/db/migrate/20160219123220_create_financial_transaction_class_and_types.rb @@ -1,12 +1,12 @@ class CreateFinancialTransactionClassAndTypes < ActiveRecord::Migration[4.2] def change create_table :financial_transaction_classes do |t| - t.string :name, :null => false + t.string :name, null: false end create_table :financial_transaction_types do |t| - t.string :name, :null => false - t.references :financial_transaction_class, :null => false + t.string :name, null: false + t.references :financial_transaction_class, null: false end change_table :financial_transactions do |t| @@ -17,7 +17,7 @@ class CreateFinancialTransactionClassAndTypes < ActiveRecord::Migration[4.2] dir.up do execute "INSERT INTO financial_transaction_classes (id, name) VALUES (1, 'Standard')" execute "INSERT INTO financial_transaction_types (id, name, financial_transaction_class_id) VALUES (1, 'Foodsoft', 1)" - execute "UPDATE financial_transactions SET financial_transaction_type_id = 1" + execute 'UPDATE financial_transactions SET financial_transaction_type_id = 1' end end diff --git a/db/migrate/20160224201529_allow_stock_group_order.rb b/db/migrate/20160224201529_allow_stock_group_order.rb index a77879e3..6c9197f0 100644 --- a/db/migrate/20160224201529_allow_stock_group_order.rb +++ b/db/migrate/20160224201529_allow_stock_group_order.rb @@ -1,9 +1,9 @@ class AllowStockGroupOrder < ActiveRecord::Migration[4.2] def self.up - change_column :group_orders, :ordergroup_id, :integer, :default => nil, :null => true + change_column :group_orders, :ordergroup_id, :integer, default: nil, null: true end def self.down - change_column :group_orders, :ordergroup_id, :integer, :default => 0, :null => false + change_column :group_orders, :ordergroup_id, :integer, default: 0, null: false end end diff --git a/db/migrate/20160226000000_add_email_to_message.foodsoft_messages_engine.rb b/db/migrate/20160226000000_add_email_to_message.foodsoft_messages_engine.rb index 95b35273..ceeafa15 100644 --- a/db/migrate/20160226000000_add_email_to_message.foodsoft_messages_engine.rb +++ b/db/migrate/20160226000000_add_email_to_message.foodsoft_messages_engine.rb @@ -2,6 +2,6 @@ class AddEmailToMessage < ActiveRecord::Migration[4.2] def change add_column :messages, :salt, :string - add_column :messages, :received_email, :binary, :limit => 1.megabyte + add_column :messages, :received_email, :binary, limit: 1.megabyte end end diff --git a/db/migrate/20170801000000_create_mail_delivery_status.rb b/db/migrate/20170801000000_create_mail_delivery_status.rb index 2fd40674..69fa1b75 100644 --- a/db/migrate/20170801000000_create_mail_delivery_status.rb +++ b/db/migrate/20170801000000_create_mail_delivery_status.rb @@ -2,8 +2,8 @@ class CreateMailDeliveryStatus < ActiveRecord::Migration[4.2] def change create_table :mail_delivery_status do |t| t.datetime :created_at - t.string :email, :null => false - t.string :message, :null => false + t.string :email, null: false + t.string :message, null: false t.string :attachment_mime t.binary :attachment_data, limit: 16.megabyte diff --git a/db/migrate/20181110000000_create_polls.foodsoft_polls_engine.rb b/db/migrate/20181110000000_create_polls.foodsoft_polls_engine.rb index 990e75f0..120b7eef 100644 --- a/db/migrate/20181110000000_create_polls.foodsoft_polls_engine.rb +++ b/db/migrate/20181110000000_create_polls.foodsoft_polls_engine.rb @@ -24,14 +24,14 @@ class CreatePolls < ActiveRecord::Migration[4.2] t.references :ordergroup t.text :note t.timestamps - t.index [:poll_id, :user_id, :ordergroup_id], unique: true + t.index %i[poll_id user_id ordergroup_id], unique: true end create_table :poll_choices do |t| t.references :poll_vote, null: false t.integer :choice, null: false t.integer :value, null: false - t.index [:poll_vote_id, :choice], unique: true + t.index %i[poll_vote_id choice], unique: true end end end diff --git a/db/migrate/20181120000000_increase_choices_size.foodsoft_polls_engine.rb b/db/migrate/20181120000000_increase_choices_size.foodsoft_polls_engine.rb index d809e3ea..621863dd 100644 --- a/db/migrate/20181120000000_increase_choices_size.foodsoft_polls_engine.rb +++ b/db/migrate/20181120000000_increase_choices_size.foodsoft_polls_engine.rb @@ -1,5 +1,5 @@ class IncreaseChoicesSize < ActiveRecord::Migration[4.2] def up - change_column :polls, :choices, :text, limit: 65535 + change_column :polls, :choices, :text, limit: 65_535 end end diff --git a/db/migrate/20181201000000_create_printer_jobs.foodsoft_printer_engine.rb b/db/migrate/20181201000000_create_printer_jobs.foodsoft_printer_engine.rb index ee7665e4..36d175c5 100644 --- a/db/migrate/20181201000000_create_printer_jobs.foodsoft_printer_engine.rb +++ b/db/migrate/20181201000000_create_printer_jobs.foodsoft_printer_engine.rb @@ -15,6 +15,6 @@ class CreatePrinterJobs < ActiveRecord::Migration[4.2] t.text :message end - add_index :printer_job_updates, [:printer_job_id, :created_at] + add_index :printer_job_updates, %i[printer_job_id created_at] end end diff --git a/db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb b/db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb index e931f748..b1d0d51c 100644 --- a/db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb +++ b/db/migrate/20181201000100_create_message_recipients.foodsoft_messages.rb @@ -14,7 +14,7 @@ class CreateMessageRecipients < ActiveRecord::Migration[4.2] t.datetime :read_at end - add_index :message_recipients, [:user_id, :read_at] + add_index :message_recipients, %i[user_id read_at] Message.all.each do |m| recipients = YAML.load(m.recipients_ids).map do |r| diff --git a/db/migrate/20190101000000_create_active_storage_tables.active_storage.rb b/db/migrate/20190101000000_create_active_storage_tables.active_storage.rb index 3739c2e8..df49a7b0 100644 --- a/db/migrate/20190101000000_create_active_storage_tables.active_storage.rb +++ b/db/migrate/20190101000000_create_active_storage_tables.active_storage.rb @@ -20,7 +20,8 @@ class CreateActiveStorageTables < ActiveRecord::Migration[4.2][5.2] t.datetime :created_at, null: false - t.index [:record_type, :record_id, :name, :blob_id], name: "index_active_storage_attachments_uniqueness", unique: true + t.index %i[record_type record_id name blob_id], name: 'index_active_storage_attachments_uniqueness', + unique: true t.foreign_key :active_storage_blobs, column: :blob_id end end diff --git a/db/migrate/20210205090257_introduce_received_state_in_orders.rb b/db/migrate/20210205090257_introduce_received_state_in_orders.rb index ffeff588..ca7ce999 100644 --- a/db/migrate/20210205090257_introduce_received_state_in_orders.rb +++ b/db/migrate/20210205090257_introduce_received_state_in_orders.rb @@ -1,7 +1,7 @@ class IntroduceReceivedStateInOrders < ActiveRecord::Migration[5.2] def up Order.where(state: 'finished').each do |order| - order.update_attribute(:state, 'received') if order.order_articles.where('units_received IS NOT NULL').any? + order.update_attribute(:state, 'received') if order.order_articles.where.not(units_received: nil).any? end end diff --git a/db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb b/db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb index a15c6ce8..379003ed 100644 --- a/db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb +++ b/db/migrate/20230106144438_add_service_name_to_active_storage_blobs.active_storage.rb @@ -3,15 +3,15 @@ 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 + return if column_exists?(:active_storage_blobs, :service_name) - if configured_service = ActiveStorage::Blob.service.name - ActiveStorage::Blob.unscoped.update_all(service_name: configured_service) - end + add_column :active_storage_blobs, :service_name, :string - change_column :active_storage_blobs, :service_name, :string, null: false + 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 def down diff --git a/db/migrate/20230106144439_create_active_storage_variant_records.active_storage.rb b/db/migrate/20230106144439_create_active_storage_variant_records.active_storage.rb index e1020fc9..58cc779a 100644 --- a/db/migrate/20230106144439_create_active_storage_variant_records.active_storage.rb +++ b/db/migrate/20230106144439_create_active_storage_variant_records.active_storage.rb @@ -8,7 +8,7 @@ class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0] 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.index %i[blob_id variation_digest], name: 'index_active_storage_variant_records_uniqueness', unique: true t.foreign_key :active_storage_blobs, column: :blob_id end end diff --git a/db/migrate/20230209105256_create_action_text_tables.action_text.rb b/db/migrate/20230209105256_create_action_text_tables.action_text.rb index 1be48d70..e9c30fac 100644 --- a/db/migrate/20230209105256_create_action_text_tables.action_text.rb +++ b/db/migrate/20230209105256_create_action_text_tables.action_text.rb @@ -11,16 +11,17 @@ class CreateActionTextTables < ActiveRecord::Migration[6.0] t.timestamps - t.index [ :record_type, :record_id, :name ], name: "index_action_text_rich_texts_uniqueness", unique: true + 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 + + 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 diff --git a/db/migrate/20230215085312_migrate_message_body_to_action_text.rb b/db/migrate/20230215085312_migrate_message_body_to_action_text.rb index 64e01214..37f8a69c 100644 --- a/db/migrate/20230215085312_migrate_message_body_to_action_text.rb +++ b/db/migrate/20230215085312_migrate_message_body_to_action_text.rb @@ -1,10 +1,32 @@ class MigrateMessageBodyToActionText < ActiveRecord::Migration[7.0] include ActionView::Helpers::TextHelper + + class Message < ApplicationRecord + has_rich_text :body + end + def change - rename_column :messages, :body, :body_old - Message.all.each do |message| - message.update_attribute(:body, simple_format(message.body_old)) + reversible do |dir| + dir.up do + rename_column :messages, :body, :body_old + Message.all.each do |message| + message.update(body: simple_format(message.body_old)) + message.body.update(record_type: :Message) # action_text_rich_texts uses STI record_type field and has to be set to the real model + end + remove_column :messages, :body_old, :text + end + dir.down do + execute "ALTER TABLE `messages` ADD `body_old` text" + execute "UPDATE `messages` m + INNER JOIN `action_text_rich_texts` a + ON m.id = a.record_id + set m.body_old = a.body" + Message.all.each do |message| + message.update(body_old: strip_tags(message.body_old)) + end + execute "DELETE FROM `action_text_rich_texts` WHERE `action_text_rich_texts`.`record_type` = 'Message'" + execute "ALTER TABLE `messages` CHANGE `body_old` `body` TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;" + end end - remove_column :messages, :body_old end end diff --git a/db/seeds.rb b/db/seeds.rb index eb1f356e..37a996ff 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,4 +1,4 @@ # 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 diff --git a/db/seeds/demo-seeds.rb b/db/seeds/demo-seeds.rb deleted file mode 100644 index 31bcdf98..00000000 --- a/db/seeds/demo-seeds.rb +++ /dev/null @@ -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") - diff --git a/db/seeds/minimal.seeds.rb b/db/seeds/minimal.seeds.rb index d38ef10e..bbf97e10 100644 --- a/db/seeds/minimal.seeds.rb +++ b/db/seeds/minimal.seeds.rb @@ -2,30 +2,30 @@ # Create working group with full rights administrators = Workgroup.create!( - :name => "Administrators", - :description => "System administrators.", - :role_admin => true, - :role_finance => true, - :role_article_meta => true, - :role_pickups => true, - :role_suppliers => true, - :role_orders => true + name: 'Administrators', + description: 'System administrators.', + role_admin: true, + role_finance: true, + role_article_meta: true, + role_pickups: true, + role_suppliers: true, + role_orders: true ) # Create admin user User.create!( - :nick => "admin", - :first_name => "Anton", - :last_name => "Administrator", - :email => "admin@foo.test", - :password => "secret", - :groups => [administrators] + nick: 'admin', + first_name: 'Anton', + last_name: 'Administrator', + email: 'admin@foo.test', + password: 'secret', + groups: [administrators] ) # First entry for financial transaction types -financial_transaction_class = FinancialTransactionClass.create!(:name => "Other") -FinancialTransactionType.create!(:name => "Foodcoop", :financial_transaction_class_id => financial_transaction_class.id) +financial_transaction_class = FinancialTransactionClass.create!(name: 'Other') +FinancialTransactionType.create!(name: 'Foodcoop', financial_transaction_class_id: financial_transaction_class.id) # First entry for article categories -SupplierCategory.create!(:name => "Other", :financial_transaction_class_id => financial_transaction_class.id) -ArticleCategory.create!(:name => "Other", :description => "other, misc, unknown") +SupplierCategory.create!(name: 'Other', financial_transaction_class_id: financial_transaction_class.id) +ArticleCategory.create!(name: 'Other', description: 'other, misc, unknown') diff --git a/db/seeds/seed_helper.rb b/db/seeds/seed_helper.rb index a1f958bf..05272319 100644 --- a/db/seeds/seed_helper.rb +++ b/db/seeds/seed_helper.rb @@ -8,10 +8,10 @@ def seed_group_orders # order 3..12 times a random article go = og.group_orders.create!(order: order, updated_by_user_id: 1) - (rand(10) + 3).times do + rand(3..12).times do 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 - goa.update_quantities rand([4, unit_quantity * 2 + 2].max), rand(unit_quantity) + goa.update_quantities rand([4, (unit_quantity * 2) + 2].max), rand(unit_quantity) end end # update totals diff --git a/db/seeds/small.en.seeds.rb b/db/seeds/small.en.seeds.rb index 52f0b9db..6c832e1d 100644 --- a/db/seeds/small.en.seeds.rb +++ b/db/seeds/small.en.seeds.rb @@ -1,174 +1,300 @@ -require_relative 'seed_helper.rb' +require_relative 'seed_helper' ## Financial transaction classes -FinancialTransactionClass.create!(:id => 1, :name => 'Standard') -FinancialTransactionClass.create!(:id => 2, :name => 'Foodsoft') +FinancialTransactionClass.create!(id: 1, name: 'Standard') +FinancialTransactionClass.create!(id: 2, name: 'Foodsoft') ## Suppliers & articles -SupplierCategory.create!(:id => 1, :name => "Other", :financial_transaction_class_id => 1) +SupplierCategory.create!(id: 1, name: 'Other', financial_transaction_class_id: 1) Supplier.create!([ - { :id => 1, :name => "Beautiful bakery", :supplier_category_id => 1, :address => "Smallstreet 1, Cookilage", :phone => "0123456789", :email => "info@bbakery.test", :min_order_quantity => "100" }, - { :id => 2, :name => "Chocolatiers", :supplier_category_id => 1, :address => "Multatuliroad 1, Amsterdam", :phone => "0123456789", :email => "info@chocolatiers.test", :url => "http://www.chocolatiers.test/", :contact_person => "Max Pure", :delivery_days => "Tue, Fr (Amsterdam)" }, - { :id => 3, :name => "Cheesemaker", :supplier_category_id => 1, :address => "Cheesestreet 5, London", :phone => "0123456789", :url => "http://www.cheesemaker.test/" }, - { :id => 4, :name => "The Nuthome", :supplier_category_id => 1, :address => "Alexanderplatz, Berlin", :phone => "0123456789", :email => "info@thenuthome.test", :url => "http://www.thenuthome.test/", :note => "delivery in Berlin; €9 delivery costs for orders under €123" } + { id: 1, name: 'Beautiful bakery', supplier_category_id: 1, + address: 'Smallstreet 1, Cookilage', phone: '0123456789', email: 'info@bbakery.test', min_order_quantity: '100' }, + { id: 2, name: 'Chocolatiers', supplier_category_id: 1, + address: 'Multatuliroad 1, Amsterdam', phone: '0123456789', email: 'info@chocolatiers.test', url: 'http://www.chocolatiers.test/', contact_person: 'Max Pure', delivery_days: 'Tue, Fr (Amsterdam)' }, + { id: 3, name: 'Cheesemaker', supplier_category_id: 1, + address: 'Cheesestreet 5, London', phone: '0123456789', url: 'http://www.cheesemaker.test/' }, + { id: 4, name: 'The Nuthome', supplier_category_id: 1, + address: 'Alexanderplatz, Berlin', phone: '0123456789', email: 'info@thenuthome.test', url: 'http://www.thenuthome.test/', note: 'delivery in Berlin; €9 delivery costs for orders under €123' } ]) -ArticleCategory.create!(:id => 1, :name => "Other", :description => "other, misc, unknown") -ArticleCategory.create!(:id => 2, :name => "Fruit") -ArticleCategory.create!(:id => 3, :name => "Vegetables") -ArticleCategory.create!(:id => 4, :name => "Potatoes & onions") -ArticleCategory.create!(:id => 5, :name => "Bread & Bakery") -ArticleCategory.create!(:id => 6, :name => "Drinks", :description => "juice, fruit juice, vegetable juice, soda") -ArticleCategory.create!(:id => 7, :name => "Herbs & Spices") -ArticleCategory.create!(:id => 8, :name => "Milk & products", :description => "milk, butter, cream, yoghurt, cheese, eggs, milk substitutes") -ArticleCategory.create!(:id => 9, :name => "Fish & Sea") -ArticleCategory.create!(:id => 10, :name => "Meat") -ArticleCategory.create!(:id => 11, :name => "Oils & Fats") -ArticleCategory.create!(:id => 12, :name => "Grains & Legumes") -ArticleCategory.create!(:id => 13, :name => "Nuts & Seeds") -ArticleCategory.create!(:id => 14, :name => "Sugar & Sweets") +ArticleCategory.create!(id: 1, name: 'Other', description: 'other, misc, unknown') +ArticleCategory.create!(id: 2, name: 'Fruit') +ArticleCategory.create!(id: 3, name: 'Vegetables') +ArticleCategory.create!(id: 4, name: 'Potatoes & onions') +ArticleCategory.create!(id: 5, name: 'Bread & Bakery') +ArticleCategory.create!(id: 6, name: 'Drinks', description: 'juice, fruit juice, vegetable juice, soda') +ArticleCategory.create!(id: 7, name: 'Herbs & Spices') +ArticleCategory.create!(id: 8, name: 'Milk & products', + description: 'milk, butter, cream, yoghurt, cheese, eggs, milk substitutes') +ArticleCategory.create!(id: 9, name: 'Fish & Sea') +ArticleCategory.create!(id: 10, name: 'Meat') +ArticleCategory.create!(id: 11, name: 'Oils & Fats') +ArticleCategory.create!(id: 12, name: 'Grains & Legumes') +ArticleCategory.create!(id: 13, name: 'Nuts & Seeds') +ArticleCategory.create!(id: 14, name: 'Sugar & Sweets') -Article.create!(:name => "Brown whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Brown half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Brown sesame whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Brown sesame half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Light wheat whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Light wheat half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Bread with sunflower seeds whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Bread with sunflower seeds half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Bread with walnuts whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Bread with walnuts half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Kennemerlandbread whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Kennemerlandbread half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Maize bread whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Maize bread half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Oberlander 1200 gram whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Oberlander 1200 gram half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Oberlander 900 gram whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Oberlander 900 gram half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Speltbread whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Speltbread half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Country bread 900gram whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Country bread 900gram half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "White whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "White half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "White with poppy seeds whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "White with poppy seeds half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Fig bread whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Fig bread half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Beer-based bread whole", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Beer-based bread half", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Raisin bun", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.99E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Muesli bun", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Brioche", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.99E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Brown croissant", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Croissants", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Cheese croissants", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocolatecroissants", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Soepstengels white", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Soepstengels volkoren", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.99E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Pumpkin-seed buns", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.88E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "White buns", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.66E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Brown buns", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.66E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Tomato-feta bread", :supplier_id => 1, :article_category_id => 5, :unit => "pc", :note => "organic", :availability => true, :manufacturer => "The Baker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocolate Bar Milk (37%)", :supplier_id => 2, :article_category_id => 14, :unit => "90gr", :note => "organic", :availability => true, :manufacturer => "Chocolatemakers", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocolate Bar Pure (68%)", :supplier_id => 2, :article_category_id => 14, :unit => "90gr", :note => "organic", :availability => true, :manufacturer => "Chocolatemakers", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocolate Bar Milk (40%)", :supplier_id => 2, :article_category_id => 14, :unit => "90gr", :note => "organic", :availability => true, :manufacturer => "Chocolatemakers", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocolate Bar Pure (75%)", :supplier_id => 2, :article_category_id => 14, :unit => "90gr", :note => "organic", :availability => true, :manufacturer => "Chocolatemakers", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocolate Bar Swan Pure (75%)", :supplier_id => 2, :article_category_id => 14, :unit => "120gr", :note => "organic", :availability => true, :manufacturer => "Chocolatemakers", :origin => "NL", :price => 0.66E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Cacao nibs", :supplier_id => 2, :article_category_id => 14, :unit => "1 kg", :note => "organic", :availability => true, :manufacturer => "Chocolatemakers", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Cheese Cow-young", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.88E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cheese cow- young matured", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.99E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cheese cow- matured", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 12) -Article.create!(:name => "Cheese cow- extra matured", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.12E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "cheese Cow- old", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "cheese cow -very old", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.12E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cheese Cow-nettle young", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.99E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cheese cow- nettle young matured", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.1075E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cheese cow- nettle matured", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cheese Cow-cumin young", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.99E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cheese cow- cumin young matured", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.1075E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cheese cow- cumin matured", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "organic", :availability => true, :manufacturer => "Cheesefarm", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cashew nuts", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.4444E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 22, :order_number => ":b936051") -Article.create!(:name => "Hazel white", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.3333E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":9e3f85b") -Article.create!(:name => "Hazel brown", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":d278041") -Article.create!(:name => "Almond Brown Spanish", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.999E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":0b51a8d") -Article.create!(:name => "Brazil nuts (organic)", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.6666E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 20, :order_number => ":01e59e3") -Article.create!(:name => "Organic walnut light halves", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.333E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":7ff8587") -Article.create!(:name => "Pinenuts", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.888E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 25, :order_number => ":aa88d9f") -Article.create!(:name => "Pumpkin", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 25, :order_number => ":e63069b") -Article.create!(:name => "Sunflower seeds (organic)", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.999E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 25, :order_number => ":0428388") -Article.create!(:name => "Amandel White Spaans", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "organic", :availability => true, :price => 0.66666E3, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":a8f0734") -Article.create!(:name => "Cashew", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.6666E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":1d26958") -Article.create!(:name => "Almonds blanched", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.333E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":31439e2") -Article.create!(:name => "Almonds natural", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":9c49374") -Article.create!(:name => "Walnut ELH halves", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.4444E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":92907d1") -Article.create!(:name => "Walnut ELP parts", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.8888E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":395640e") -Article.create!(:name => "Brazil nuts", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.8888E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":710acbb") -Article.create!(:name => "Macadamia type 0", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.3333E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":bbaf40b") -Article.create!(:name => "Pecan", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.55555E3, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":7958183") -Article.create!(:name => "Hazelnuts natural", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.6666E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":50392a8") -Article.create!(:name => "Hazelnuts blanched", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.3333E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":4fe6525") -Article.create!(:name => "Mixed Nuts", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.333E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":c051b22") -Article.create!(:name => "Peanuts", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.777E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":f507577") -Article.create!(:name => "Small peanuts", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.8888E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":ce563bb") -Article.create!(:name => "Medjoul dates", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.3333E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":8232061") -Article.create!(:name => "Turkish apricots natural", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.888E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":185084f") -Article.create!(:name => "Turkish apricots sulfurised", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":2b2fb20") -Article.create!(:name => "Spanish Figs", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.444E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":82590b1") -Article.create!(:name => "Turkish Figs", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.555E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":cabeeb6") -Article.create!(:name => "Sour Apricots South-Africa", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":2ac18b7") -Article.create!(:name => "Blue raisins Flames", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":16bfa75") -Article.create!(:name => "Yellow Raisins", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.2222E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":1c59324") -Article.create!(:name => "Red Raisins", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":c3fcd84") -Article.create!(:name => "Cranberries whole", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.222E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":921c168") -Article.create!(:name => "Dried apples", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.555E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":902c67b") -Article.create!(:name => "Dried plums without core", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.222E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":a847f91") -Article.create!(:name => "Pumpkin seeds", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.111E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":535645f") -Article.create!(:name => "Sunflower seeds", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.666E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":4ab9a83") -Article.create!(:name => "Linseed", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.55E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":04be223") -Article.create!(:name => "Poppy seeds", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.7777E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":ec5b2b9") -Article.create!(:name => "Pine nuts medium china", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.2222E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":0e5b0b8") -Article.create!(:name => "Goji berries", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.888E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":d52ee00") -Article.create!(:name => "Mulberries", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.5555E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":5f46bd5") -Article.create!(:name => "Peeled Hemp", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.5555E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":c39165b") -Article.create!(:name => "Incaberries", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.888E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":8d44fe7") -Article.create!(:name => "Blueberries", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.2222E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":9a95422") -Article.create!(:name => "Chia seeds", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.55555E3, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":416d57b") -Article.create!(:name => "Coconut grated", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.55E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":b3f65e4") +Article.create!(name: 'Brown whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Brown half', supplier_id: 1, article_category_id: 5, unit: 'pc', note: 'organic', + availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Brown sesame whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Brown sesame half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Light wheat whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Light wheat half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Bread with sunflower seeds whole', supplier_id: 1, article_category_id: 5, + unit: 'pc', note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Bread with sunflower seeds half', supplier_id: 1, article_category_id: 5, + unit: 'pc', note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Bread with walnuts whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Bread with walnuts half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Kennemerlandbread whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Kennemerlandbread half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Maize bread whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Maize bread half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Oberlander 1200 gram whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Oberlander 1200 gram half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Oberlander 900 gram whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Oberlander 900 gram half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Speltbread whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Speltbread half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Country bread 900gram whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Country bread 900gram half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'White whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'White half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'White with poppy seeds whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'White with poppy seeds half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Fig bread whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Fig bread half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Beer-based bread whole', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Beer-based bread half', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Raisin bun', supplier_id: 1, article_category_id: 5, unit: 'pc', note: 'organic', + availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.99E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Muesli bun', supplier_id: 1, article_category_id: 5, unit: 'pc', note: 'organic', + availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Brioche', supplier_id: 1, article_category_id: 5, unit: 'pc', note: 'organic', + availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.99E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Brown croissant', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Croissants', supplier_id: 1, article_category_id: 5, unit: 'pc', note: 'organic', + availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Cheese croissants', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocolatecroissants', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Soepstengels white', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Soepstengels volkoren', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.99E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Pumpkin-seed buns', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.88E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'White buns', supplier_id: 1, article_category_id: 5, unit: 'pc', note: 'organic', + availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.66E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Brown buns', supplier_id: 1, article_category_id: 5, unit: 'pc', note: 'organic', + availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.66E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Tomato-feta bread', supplier_id: 1, article_category_id: 5, unit: 'pc', + note: 'organic', availability: true, manufacturer: 'The Baker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocolate Bar Milk (37%)', supplier_id: 2, article_category_id: 14, unit: '90gr', + note: 'organic', availability: true, manufacturer: 'Chocolatemakers', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocolate Bar Pure (68%)', supplier_id: 2, article_category_id: 14, unit: '90gr', + note: 'organic', availability: true, manufacturer: 'Chocolatemakers', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocolate Bar Milk (40%)', supplier_id: 2, article_category_id: 14, unit: '90gr', + note: 'organic', availability: true, manufacturer: 'Chocolatemakers', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocolate Bar Pure (75%)', supplier_id: 2, article_category_id: 14, unit: '90gr', + note: 'organic', availability: true, manufacturer: 'Chocolatemakers', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocolate Bar Swan Pure (75%)', supplier_id: 2, article_category_id: 14, + unit: '120gr', note: 'organic', availability: true, manufacturer: 'Chocolatemakers', origin: 'NL', price: 0.66E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Cacao nibs', supplier_id: 2, article_category_id: 14, unit: '1 kg', + note: 'organic', availability: true, manufacturer: 'Chocolatemakers', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Cheese Cow-young', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.88E1, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cheese cow- young matured', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.99E1, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cheese cow- matured', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 12) +Article.create!(name: 'Cheese cow- extra matured', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.12E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'cheese Cow- old', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'cheese cow -very old', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.12E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cheese Cow-nettle young', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.99E1, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cheese cow- nettle young matured', supplier_id: 3, article_category_id: 8, + unit: 'kg', note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.1075E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cheese cow- nettle matured', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cheese Cow-cumin young', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.99E1, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cheese cow- cumin young matured', supplier_id: 3, article_category_id: 8, + unit: 'kg', note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.1075E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cheese cow- cumin matured', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'organic', availability: true, manufacturer: 'Cheesefarm', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cashew nuts', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'organic', availability: true, price: 0.4444E2, tax: 6.0, deposit: 0.0, unit_quantity: 22, order_number: ':b936051') +Article.create!(name: 'Hazel white', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'organic', availability: true, price: 0.3333E2, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':9e3f85b') +Article.create!(name: 'Hazel brown', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'organic', availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':d278041') +Article.create!(name: 'Almond Brown Spanish', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'organic', availability: true, price: 0.999E1, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':0b51a8d') +Article.create!(name: 'Brazil nuts (organic)', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'organic', availability: true, price: 0.6666E2, tax: 6.0, deposit: 0.0, unit_quantity: 20, order_number: ':01e59e3') +Article.create!(name: 'Organic walnut light halves', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'organic', availability: true, price: 0.333E1, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':7ff8587') +Article.create!(name: 'Pinenuts', supplier_id: 4, article_category_id: 13, unit: 'kg', note: 'organic', + availability: true, price: 0.888E1, tax: 6.0, deposit: 0.0, unit_quantity: 25, order_number: ':aa88d9f') +Article.create!(name: 'Pumpkin', supplier_id: 4, article_category_id: 13, unit: 'kg', note: 'organic', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 25, order_number: ':e63069b') +Article.create!(name: 'Sunflower seeds (organic)', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'organic', availability: true, price: 0.999E1, tax: 6.0, deposit: 0.0, unit_quantity: 25, order_number: ':0428388') +Article.create!(name: 'Amandel White Spaans', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'organic', availability: true, price: 0.66666E3, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':a8f0734') +Article.create!(name: 'Cashew', supplier_id: 4, article_category_id: 13, unit: 'kg', availability: true, + price: 0.6666E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':1d26958') +Article.create!(name: 'Almonds blanched', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.333E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':31439e2') +Article.create!(name: 'Almonds natural', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':9c49374') +Article.create!(name: 'Walnut ELH halves', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.4444E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':92907d1') +Article.create!(name: 'Walnut ELP parts', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.8888E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':395640e') +Article.create!(name: 'Brazil nuts', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.8888E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':710acbb') +Article.create!(name: 'Macadamia type 0', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.3333E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':bbaf40b') +Article.create!(name: 'Pecan', supplier_id: 4, article_category_id: 13, unit: 'kg', availability: true, + price: 0.55555E3, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':7958183') +Article.create!(name: 'Hazelnuts natural', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.6666E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':50392a8') +Article.create!(name: 'Hazelnuts blanched', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.3333E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':4fe6525') +Article.create!(name: 'Mixed Nuts', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.333E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':c051b22') +Article.create!(name: 'Peanuts', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.777E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':f507577') +Article.create!(name: 'Small peanuts', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.8888E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':ce563bb') +Article.create!(name: 'Medjoul dates', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.3333E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':8232061') +Article.create!(name: 'Turkish apricots natural', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.888E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':185084f') +Article.create!(name: 'Turkish apricots sulfurised', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':2b2fb20') +Article.create!(name: 'Spanish Figs', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.444E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':82590b1') +Article.create!(name: 'Turkish Figs', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.555E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':cabeeb6') +Article.create!(name: 'Sour Apricots South-Africa', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':2ac18b7') +Article.create!(name: 'Blue raisins Flames', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':16bfa75') +Article.create!(name: 'Yellow Raisins', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.2222E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':1c59324') +Article.create!(name: 'Red Raisins', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':c3fcd84') +Article.create!(name: 'Cranberries whole', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.222E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':921c168') +Article.create!(name: 'Dried apples', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.555E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':902c67b') +Article.create!(name: 'Dried plums without core', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.222E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':a847f91') +Article.create!(name: 'Pumpkin seeds', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.111E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':535645f') +Article.create!(name: 'Sunflower seeds', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.666E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':4ab9a83') +Article.create!(name: 'Linseed', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.55E0, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':04be223') +Article.create!(name: 'Poppy seeds', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.7777E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':ec5b2b9') +Article.create!(name: 'Pine nuts medium china', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.2222E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':0e5b0b8') +Article.create!(name: 'Goji berries', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.888E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':d52ee00') +Article.create!(name: 'Mulberries', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.5555E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':5f46bd5') +Article.create!(name: 'Peeled Hemp', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.5555E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':c39165b') +Article.create!(name: 'Incaberries', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.888E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':8d44fe7') +Article.create!(name: 'Blueberries', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.2222E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':9a95422') +Article.create!(name: 'Chia seeds', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.55555E3, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':416d57b') +Article.create!(name: 'Coconut grated', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.55E0, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':b3f65e4') ## Members & groups -User.create!(:id => 1, :nick => "admin", :password => "secret", :first_name => "Anton", :last_name => "Administrator", :email => "admin@foo.test", :phone => "+4421486548", :created_on => 'Wed, 15 Jan 2014 16:15:33 UTC +00:00') -User.create!(:id => 2, :nick => "john", :password => "secret", :first_name => "John", :last_name => "Doe", :email => "john@doe.test", :created_on => 'Sun, 19 Jan 2014 17:38:22 UTC +00:00') -User.create!(:id => 3, :nick => "peter", :password => "secret", :first_name => "Peter", :last_name => "Peters", :email => "peter@peters.test", :phone => "+4711235486811", :created_on => 'Sat, 25 Jan 2014 20:20:36 UTC +00:00') -User.create!(:id => 4, :nick => "jan", :password => "secret", :first_name => "Jan", :last_name => "Lou", :email => "jan@lou.test", :created_on => 'Mon, 27 Jan 2014 16:22:14 UTC +00:00') -User.create!(:id => 5, :nick => "mary", :password => "secret", :first_name => "Mary", :last_name => "Lou", :email => "marie@lou.test", :created_on => 'Mon, 03 Feb 2014 11:47:17 UTC +00:00') -User.find_by_nick("mary").update(last_activity: 5.days.ago) +User.create!(id: 1, nick: 'admin', password: 'secret', first_name: 'Anton', last_name: 'Administrator', + email: 'admin@foo.test', phone: '+4421486548', created_on: 'Wed, 15 Jan 2014 16:15:33 UTC +00:00') +User.create!(id: 2, nick: 'john', password: 'secret', first_name: 'John', last_name: 'Doe', + email: 'john@doe.test', created_on: 'Sun, 19 Jan 2014 17:38:22 UTC +00:00') +User.create!(id: 3, nick: 'peter', password: 'secret', first_name: 'Peter', last_name: 'Peters', + email: 'peter@peters.test', phone: '+4711235486811', created_on: 'Sat, 25 Jan 2014 20:20:36 UTC +00:00') +User.create!(id: 4, nick: 'jan', password: 'secret', first_name: 'Jan', last_name: 'Lou', + email: 'jan@lou.test', created_on: 'Mon, 27 Jan 2014 16:22:14 UTC +00:00') +User.create!(id: 5, nick: 'mary', password: 'secret', first_name: 'Mary', last_name: 'Lou', + email: 'marie@lou.test', created_on: 'Mon, 03 Feb 2014 11:47:17 UTC +00:00') +User.find_by_nick('mary').update(last_activity: 5.days.ago) -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) -Workgroup.create!(:id => 3, :name => "Ordering", :account_balance => 0.0, :created_on => 'Thu, 20 Feb 2014 14:44:47 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => true, :role_finance => false, :role_orders => true, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false) -Workgroup.create!(:id => 4, :name => "Assortment", :account_balance => 0.0, :created_on => 'Wed, 09 Apr 2014 12:24:55 UTC +00:00', :role_admin => false, :role_suppliers => true, :role_article_meta => true, :role_finance => false, :role_orders => false, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false) -Ordergroup.create!(:id => 5, :name => "Admin Administrator", :account_balance => 0.0, :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 => 6, :name => "Pete's house", :account_balance => -0.35E2, :created_on => 'Sat, 25 Jan 2014 20:20:37 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => false, :role_finance => false, :role_orders => false, :contact_person => "Piet Pieterssen", :stats => { :jobs_size => 0, :orders_sum => 60.96 }, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false) -Ordergroup.create!(:id => 7, :name => "Jan Klaassen", :account_balance => -0.35E2, :created_on => 'Mon, 27 Jan 2014 16:22:14 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => false, :role_finance => false, :role_orders => false, :contact_person => "Jan Klaassen", :stats => { :jobs_size => 0, :orders_sum => 0 }, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false) -Ordergroup.create!(:id => 8, :name => "John Doe", :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) +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) +Workgroup.create!(id: 3, name: 'Ordering', account_balance: 0.0, + created_on: 'Thu, 20 Feb 2014 14:44:47 UTC +00:00', role_admin: false, role_suppliers: false, role_article_meta: true, role_finance: false, role_orders: true, next_weekly_tasks_number: 8, ignore_apple_restriction: false) +Workgroup.create!(id: 4, name: 'Assortment', account_balance: 0.0, + created_on: 'Wed, 09 Apr 2014 12:24:55 UTC +00:00', role_admin: false, role_suppliers: true, role_article_meta: true, role_finance: false, role_orders: false, next_weekly_tasks_number: 8, ignore_apple_restriction: false) +Ordergroup.create!(id: 5, name: 'Admin Administrator', account_balance: 0.0, + 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: 6, name: "Pete's house", account_balance: -0.35E2, + created_on: 'Sat, 25 Jan 2014 20:20:37 UTC +00:00', role_admin: false, role_suppliers: false, role_article_meta: false, role_finance: false, role_orders: false, contact_person: 'Piet Pieterssen', stats: { jobs_size: 0, orders_sum: 60.96 }, next_weekly_tasks_number: 8, ignore_apple_restriction: false) +Ordergroup.create!(id: 7, name: 'Jan Klaassen', account_balance: -0.35E2, + created_on: 'Mon, 27 Jan 2014 16:22:14 UTC +00:00', role_admin: false, role_suppliers: false, role_article_meta: false, role_finance: false, role_orders: false, contact_person: 'Jan Klaassen', stats: { jobs_size: 0, orders_sum: 0 }, next_weekly_tasks_number: 8, ignore_apple_restriction: false) +Ordergroup.create!(id: 8, name: 'John Doe', 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) -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) -Membership.create!(:group_id => 6, :user_id => 3) -Membership.create!(:group_id => 7, :user_id => 4) -Membership.create!(:group_id => 8, :user_id => 4) -Membership.create!(:group_id => 3, :user_id => 4) -Membership.create!(:group_id => 7, :user_id => 5) -Membership.create!(:group_id => 3, :user_id => 5) -Membership.create!(:group_id => 4, :user_id => 5) +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) +Membership.create!(group_id: 6, user_id: 3) +Membership.create!(group_id: 7, user_id: 4) +Membership.create!(group_id: 8, user_id: 4) +Membership.create!(group_id: 3, user_id: 4) +Membership.create!(group_id: 7, user_id: 5) +Membership.create!(group_id: 3, user_id: 5) +Membership.create!(group_id: 4, user_id: 5) ## Orders & OrderArticles @@ -182,10 +308,15 @@ seed_group_orders ## Finances -FinancialTransactionType.create!(:id => 1, :name => "Foodcoop", :financial_transaction_class_id => 1) +FinancialTransactionType.create!(id: 1, name: 'Foodcoop', financial_transaction_class_id: 1) -FinancialTransaction.create!(:id => 1, :ordergroup_id => 5, :amount => -0.35E2, :note => "Membership fee for ordergroup", :user_id => 1, :created_on => 'Sat, 18 Jan 2014 00:38:48 UTC +00:00', :financial_transaction_type_id => 1) -FinancialTransaction.create!(:id => 3, :ordergroup_id => 6, :amount => -0.35E2, :note => "Membership fee for ordergroup", :user_id => 1, :created_on => 'Sat, 25 Jan 2014 20:20:37 UTC +00:00', :financial_transaction_type_id => 1) -FinancialTransaction.create!(:id => 4, :ordergroup_id => 7, :amount => -0.35E2, :note => "Membership fee for ordergroup", :user_id => 1, :created_on => 'Mon, 27 Jan 2014 16:22:14 UTC +00:00', :financial_transaction_type_id => 1) -FinancialTransaction.create!(:id => 5, :ordergroup_id => 5, :amount => 0.35E2, :note => "payment", :user_id => 2, :created_on => 'Wed, 05 Feb 2014 16:49:24 UTC +00:00', :financial_transaction_type_id => 1) -FinancialTransaction.create!(:id => 6, :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) +FinancialTransaction.create!(id: 1, ordergroup_id: 5, amount: -0.35E2, + note: 'Membership fee for ordergroup', user_id: 1, created_on: 'Sat, 18 Jan 2014 00:38:48 UTC +00:00', financial_transaction_type_id: 1) +FinancialTransaction.create!(id: 3, ordergroup_id: 6, amount: -0.35E2, + note: 'Membership fee for ordergroup', user_id: 1, created_on: 'Sat, 25 Jan 2014 20:20:37 UTC +00:00', financial_transaction_type_id: 1) +FinancialTransaction.create!(id: 4, ordergroup_id: 7, amount: -0.35E2, + note: 'Membership fee for ordergroup', user_id: 1, created_on: 'Mon, 27 Jan 2014 16:22:14 UTC +00:00', financial_transaction_type_id: 1) +FinancialTransaction.create!(id: 5, ordergroup_id: 5, amount: 0.35E2, note: 'payment', user_id: 2, + created_on: 'Wed, 05 Feb 2014 16:49:24 UTC +00:00', financial_transaction_type_id: 1) +FinancialTransaction.create!(id: 6, 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) diff --git a/db/seeds/small.nl.seeds.rb b/db/seeds/small.nl.seeds.rb index afa9cc04..1dd39992 100644 --- a/db/seeds/small.nl.seeds.rb +++ b/db/seeds/small.nl.seeds.rb @@ -1,173 +1,300 @@ -require_relative 'seed_helper.rb' +require_relative 'seed_helper' ## Financial transaction classes -FinancialTransactionClass.create!(:id => 1, :name => 'Standaard') -FinancialTransactionClass.create!(:id => 2, :name => 'Foodsoft') +FinancialTransactionClass.create!(id: 1, name: 'Standaard') +FinancialTransactionClass.create!(id: 2, name: 'Foodsoft') ## Suppliers & articles -SupplierCategory.create!(:id => 1, :name => "Other", :financial_transaction_class_id => 1) +SupplierCategory.create!(id: 1, name: 'Other', financial_transaction_class_id: 1) Supplier.create!([ - { :id => 1, :name => "Koekenbakker", :supplier_category_id => 1, :address => "Dorpsstraat 1, Koekange", :phone => "012 3456789", :email => "info@dekoekenbakker.test", :min_order_quantity => "100" }, - { :id => 2, :name => "Chocolademakkers", :supplier_category_id => 1, :address => "Multatuliweg 1, Amsterdam", :phone => "012 3456789", :email => "info@chocolademakkers.test", :url => "http://www.chocolademakkers.test/", :contact_person => "Max Puur", :delivery_days => "di, vr (Amsterdam)" }, - { :id => 3, :name => "Kaasmaker", :supplier_category_id => 1, :address => "Waagplein, Alkmaar", :phone => "012 3456789", :url => "http://www.kaaskamer.test/" }, - { :id => 4, :name => "Notenhuis", :supplier_category_id => 1, :address => "Damrak 1, Amsterdam", :phone => "012 3456789", :email => "info@notenhuis.test", :url => "http://www.notenhuis.test/", :note => "leveren in Amsterdam; €9 leverkosten bij bestellingen onder €123" } + { id: 1, name: 'Koekenbakker', supplier_category_id: 1, + address: 'Dorpsstraat 1, Koekange', phone: '012 3456789', email: 'info@dekoekenbakker.test', min_order_quantity: '100' }, + { id: 2, name: 'Chocolademakkers', supplier_category_id: 1, + address: 'Multatuliweg 1, Amsterdam', phone: '012 3456789', email: 'info@chocolademakkers.test', url: 'http://www.chocolademakkers.test/', contact_person: 'Max Puur', delivery_days: 'di, vr (Amsterdam)' }, + { id: 3, name: 'Kaasmaker', supplier_category_id: 1, address: 'Waagplein, Alkmaar', + phone: '012 3456789', url: 'http://www.kaaskamer.test/' }, + { id: 4, name: 'Notenhuis', supplier_category_id: 1, address: 'Damrak 1, Amsterdam', + phone: '012 3456789', email: 'info@notenhuis.test', url: 'http://www.notenhuis.test/', note: 'leveren in Amsterdam; €9 leverkosten bij bestellingen onder €123' } ]) -ArticleCategory.create!(:id => 1, :name => "Other", :description => "overig, anders, onbekend") -ArticleCategory.create!(:id => 2, :name => "Fruit") -ArticleCategory.create!(:id => 3, :name => "Groenten") -ArticleCategory.create!(:id => 4, :name => "Aardappels & uien") -ArticleCategory.create!(:id => 5, :name => "Brood & Bakkerij") -ArticleCategory.create!(:id => 6, :name => "Dranken", :description => "sap, fruitsap, groentesap, frisdrank") -ArticleCategory.create!(:id => 7, :name => "Kruiden", :description => "kruiden, specerijen, conserveringsmiddelen, extracten") -ArticleCategory.create!(:id => 8, :name => "Zuivel", :description => "melk, boter, room, yoghurt, kaas, eieren, zuivelvervangers") -ArticleCategory.create!(:id => 9, :name => "Vis & Zee", :description => "vis, schaaldieren, schelpdieren") -ArticleCategory.create!(:id => 10, :name => "Vlees & Gevogelte") -ArticleCategory.create!(:id => 11, :name => "Oliën & Vetten") -ArticleCategory.create!(:id => 12, :name => "Graan & Peulvruchten") -ArticleCategory.create!(:id => 13, :name => "Noten & Zaden") -ArticleCategory.create!(:id => 14, :name => "Zoetwaren & Zoetstof") +ArticleCategory.create!(id: 1, name: 'Other', description: 'overig, anders, onbekend') +ArticleCategory.create!(id: 2, name: 'Fruit') +ArticleCategory.create!(id: 3, name: 'Groenten') +ArticleCategory.create!(id: 4, name: 'Aardappels & uien') +ArticleCategory.create!(id: 5, name: 'Brood & Bakkerij') +ArticleCategory.create!(id: 6, name: 'Dranken', description: 'sap, fruitsap, groentesap, frisdrank') +ArticleCategory.create!(id: 7, name: 'Kruiden', + description: 'kruiden, specerijen, conserveringsmiddelen, extracten') +ArticleCategory.create!(id: 8, name: 'Zuivel', + description: 'melk, boter, room, yoghurt, kaas, eieren, zuivelvervangers') +ArticleCategory.create!(id: 9, name: 'Vis & Zee', description: 'vis, schaaldieren, schelpdieren') +ArticleCategory.create!(id: 10, name: 'Vlees & Gevogelte') +ArticleCategory.create!(id: 11, name: 'Oliën & Vetten') +ArticleCategory.create!(id: 12, name: 'Graan & Peulvruchten') +ArticleCategory.create!(id: 13, name: 'Noten & Zaden') +ArticleCategory.create!(id: 14, name: 'Zoetwaren & Zoetstof') -Article.create!(:name => "Volkoren heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Volkoren half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Volkoren sesam heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Volkoren sesam half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Licht tarwe heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Licht tarwe half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Zonnebloempitbrood heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Zonnebloempitbrood half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Walnoten vloer heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Walnoten vloer half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Kennemerlandbrood heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Kennemerlandbrood half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Maisbrood heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Maisbrood half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Oberlander 1200 gram heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Oberlander 1200 gram half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Oberlander 900 gram heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Oberlander 900 gram half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Speltbrood heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Speltbrood half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Landbrood 900gram heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Landbrood 900gram half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Wit heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Wit half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Wit met maanzaad heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Wit met maanzaad half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Vijgenbrood heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Vijgenbrood half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Bierborstelbrood heel", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.33E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Bierborstelbrood half", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Krentenbol", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.99E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Mueslibol", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Brioche", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.91E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Volkoren croissant", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Croissants", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Kaas croissants", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocoladecroissants", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Soepstengels wit", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Soepstengels volkoren", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.99E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Pompoenpitten broodjes", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.88E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Witte kadetjes", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.66E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Bruine kadetjes", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.66E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Tomaten feta broodje", :supplier_id => 1, :article_category_id => 5, :unit => "stuk", :note => "bio", :availability => true, :manufacturer => "De Bakker", :origin => "NL", :price => 0.11E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocoladereep Melk (37%)", :supplier_id => 2, :article_category_id => 14, :unit => "90gr", :note => "bio", :availability => true, :manufacturer => "Chocolademakkers", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocoladereep Puur (68%)", :supplier_id => 2, :article_category_id => 14, :unit => "90gr", :note => "bio", :availability => true, :manufacturer => "Chocolademakkers", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocoladereep Drie Mensen Melk (40%)", :supplier_id => 2, :article_category_id => 14, :unit => "90gr", :note => "bio", :availability => true, :manufacturer => "Chocolademakkers", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocoladereep Drie Mensen Puur (75%)", :supplier_id => 2, :article_category_id => 14, :unit => "90gr", :note => "bio", :availability => true, :manufacturer => "Chocolademakkers", :origin => "NL", :price => 0.22E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Chocoladereep Zwaan Puur (75%)", :supplier_id => 2, :article_category_id => 14, :unit => "120gr", :note => "bio", :availability => true, :manufacturer => "Chocolademakkers", :origin => "NL", :price => 0.66E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Cacao nibs", :supplier_id => 2, :article_category_id => 14, :unit => "1 kg", :note => "bio", :availability => true, :manufacturer => "Chocolademakkers", :origin => "NL", :price => 0.10E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1) -Article.create!(:name => "Kaas Koe-jong", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.88E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Kaas koe- jong belegen", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.99E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Kaas koe- belegen", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 12) -Article.create!(:name => "Kaas koe- extra belegen", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "kaas Koe- oud", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.1375E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "kaas koe -overjarig", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Kaas Koe-brandnetel jong", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.99E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Kaas koe- brandnetel jong belegen", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Kaas koe- brandnetel belegen", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Kaas Koe-komijn jong", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.99E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Kaas koe- komijn jong belegen", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Kaas koe- komijn belegen", :supplier_id => 3, :article_category_id => 8, :unit => "kg", :note => "bio", :availability => true, :manufacturer => "Kaasboerderij", :origin => "NL", :price => 0.11E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 8) -Article.create!(:name => "Cashewnoten", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.4444E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 22, :order_number => ":b936051") -Article.create!(:name => "Hazel wit", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.3333E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":9e3f85b") -Article.create!(:name => "Hazel bruin", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":d278041") -Article.create!(:name => "Amandel Bruin Spaans", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.999E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":0b51a8d") -Article.create!(:name => "Paranoten (bio)", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.6666E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 20, :order_number => ":01e59e3") -Article.create!(:name => "Bio walnoten light halfjes", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.333E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":7ff8587") -Article.create!(:name => "Pijnboompitten", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.888E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 25, :order_number => ":aa88d9f") -Article.create!(:name => "Pompoen", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 25, :order_number => ":e63069b") -Article.create!(:name => "Zonnepitten (bio)", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.999E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 25, :order_number => ":0428388") -Article.create!(:name => "Amandel Wit Spaans", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :note => "bio", :availability => true, :price => 0.66666E3, :tax => 6.0, :deposit => 0.0, :unit_quantity => 10, :order_number => ":a8f0734") -Article.create!(:name => "Cashew", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.6666E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":1d26958") -Article.create!(:name => "Amandelen geblancheerd", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.333E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":31439e2") -Article.create!(:name => "Amandelen naturel", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":9c49374") -Article.create!(:name => "Walnoot ELH hafjes", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.4444E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":92907d1") -Article.create!(:name => "Walnoot ELP stukjes", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.8888E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":395640e") -Article.create!(:name => "Paranoten", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.8888E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":710acbb") -Article.create!(:name => "Macadamia Stijl 0", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.3333E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":bbaf40b") -Article.create!(:name => "Pecan", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.55555E3, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":7958183") -Article.create!(:name => "Hazelnoten naturel", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.6666E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":50392a8") -Article.create!(:name => "Hazelnoten geblancheerd", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.3333E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":4fe6525") -Article.create!(:name => "Gemengde Noten", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.333E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":c051b22") -Article.create!(:name => "Pinda's", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.777E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":f507577") -Article.create!(:name => "Vliespinda's klein", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.8888E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":ce563bb") -Article.create!(:name => "Medjoul dadels", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.3333E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":8232061") -Article.create!(:name => "Turkse Abrikozen ongezwaveld", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.888E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":185084f") -Article.create!(:name => "Turkse Abrikozen gezwaveld", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":2b2fb20") -Article.create!(:name => "Spaanse Vijgen", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.444E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":82590b1") -Article.create!(:name => "Turkse Vijgen", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.555E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":cabeeb6") -Article.create!(:name => "Zure Abrikozen Zuid Afrika", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":2ac18b7") -Article.create!(:name => "Blauwe rozijnen Flames", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":16bfa75") -Article.create!(:name => "Gele Rozijnen", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.2222E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":1c59324") -Article.create!(:name => "Rode Rozijnen", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.1111E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":c3fcd84") -Article.create!(:name => "Cranberries heel", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.222E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":921c168") -Article.create!(:name => "Gedroogde Appeltjes", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.555E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":902c67b") -Article.create!(:name => "Gedroogde pruimen zonder pit", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.222E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":a847f91") -Article.create!(:name => "Pompoenpitten", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.111E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":535645f") -Article.create!(:name => "Zonnenbloepitten", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.666E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":4ab9a83") -Article.create!(:name => "Lijnzaad", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.55E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":04be223") -Article.create!(:name => "Maanzaad", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.7777E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":ec5b2b9") -Article.create!(:name => "Pijnboompitten medium china", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.2222E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":0e5b0b8") -Article.create!(:name => "Goji bessen", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.888E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":d52ee00") -Article.create!(:name => "Mulberries", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.5555E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":5f46bd5") -Article.create!(:name => "Gepelde Hennep", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.5555E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":c39165b") -Article.create!(:name => "Incaberries", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.888E1, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":8d44fe7") -Article.create!(:name => "Blueberries", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.2222E2, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":9a95422") -Article.create!(:name => "Chia zaad", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.55555E3, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":416d57b") -Article.create!(:name => "Cocos Rasp", :supplier_id => 4, :article_category_id => 13, :unit => "kg", :availability => true, :price => 0.55E0, :tax => 6.0, :deposit => 0.0, :unit_quantity => 1, :order_number => ":b3f65e4") +Article.create!(name: 'Volkoren heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Volkoren half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Volkoren sesam heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Volkoren sesam half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Licht tarwe heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Licht tarwe half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Zonnebloempitbrood heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Zonnebloempitbrood half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Walnoten vloer heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Walnoten vloer half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Kennemerlandbrood heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Kennemerlandbrood half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Maisbrood heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Maisbrood half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Oberlander 1200 gram heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Oberlander 1200 gram half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Oberlander 900 gram heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Oberlander 900 gram half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Speltbrood heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Speltbrood half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Landbrood 900gram heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Landbrood 900gram half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Wit heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', note: 'bio', + availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Wit half', supplier_id: 1, article_category_id: 5, unit: 'stuk', note: 'bio', + availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Wit met maanzaad heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Wit met maanzaad half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Vijgenbrood heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Vijgenbrood half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Bierborstelbrood heel', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.33E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Bierborstelbrood half', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Krentenbol', supplier_id: 1, article_category_id: 5, unit: 'stuk', note: 'bio', + availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.99E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Mueslibol', supplier_id: 1, article_category_id: 5, unit: 'stuk', note: 'bio', + availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Brioche', supplier_id: 1, article_category_id: 5, unit: 'stuk', note: 'bio', + availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.91E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Volkoren croissant', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Croissants', supplier_id: 1, article_category_id: 5, unit: 'stuk', note: 'bio', + availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Kaas croissants', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocoladecroissants', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Soepstengels wit', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Soepstengels volkoren', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.99E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Pompoenpitten broodjes', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.88E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Witte kadetjes', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.66E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Bruine kadetjes', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.66E0, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Tomaten feta broodje', supplier_id: 1, article_category_id: 5, unit: 'stuk', + note: 'bio', availability: true, manufacturer: 'De Bakker', origin: 'NL', price: 0.11E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocoladereep Melk (37%)', supplier_id: 2, article_category_id: 14, unit: '90gr', + note: 'bio', availability: true, manufacturer: 'Chocolademakkers', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocoladereep Puur (68%)', supplier_id: 2, article_category_id: 14, unit: '90gr', + note: 'bio', availability: true, manufacturer: 'Chocolademakkers', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocoladereep Drie Mensen Melk (40%)', supplier_id: 2, article_category_id: 14, + unit: '90gr', note: 'bio', availability: true, manufacturer: 'Chocolademakkers', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocoladereep Drie Mensen Puur (75%)', supplier_id: 2, article_category_id: 14, + unit: '90gr', note: 'bio', availability: true, manufacturer: 'Chocolademakkers', origin: 'NL', price: 0.22E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Chocoladereep Zwaan Puur (75%)', supplier_id: 2, article_category_id: 14, + unit: '120gr', note: 'bio', availability: true, manufacturer: 'Chocolademakkers', origin: 'NL', price: 0.66E1, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Cacao nibs', supplier_id: 2, article_category_id: 14, unit: '1 kg', note: 'bio', + availability: true, manufacturer: 'Chocolademakkers', origin: 'NL', price: 0.10E2, tax: 6.0, deposit: 0.0, unit_quantity: 1) +Article.create!(name: 'Kaas Koe-jong', supplier_id: 3, article_category_id: 8, unit: 'kg', note: 'bio', + availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.88E1, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Kaas koe- jong belegen', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.99E1, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Kaas koe- belegen', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 12) +Article.create!(name: 'Kaas koe- extra belegen', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'kaas Koe- oud', supplier_id: 3, article_category_id: 8, unit: 'kg', note: 'bio', + availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.1375E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'kaas koe -overjarig', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Kaas Koe-brandnetel jong', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.99E1, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Kaas koe- brandnetel jong belegen', supplier_id: 3, article_category_id: 8, + unit: 'kg', note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Kaas koe- brandnetel belegen', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Kaas Koe-komijn jong', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.99E1, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Kaas koe- komijn jong belegen', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Kaas koe- komijn belegen', supplier_id: 3, article_category_id: 8, unit: 'kg', + note: 'bio', availability: true, manufacturer: 'Kaasboerderij', origin: 'NL', price: 0.11E2, tax: 6.0, deposit: 0.0, unit_quantity: 8) +Article.create!(name: 'Cashewnoten', supplier_id: 4, article_category_id: 13, unit: 'kg', note: 'bio', + availability: true, price: 0.4444E2, tax: 6.0, deposit: 0.0, unit_quantity: 22, order_number: ':b936051') +Article.create!(name: 'Hazel wit', supplier_id: 4, article_category_id: 13, unit: 'kg', note: 'bio', + availability: true, price: 0.3333E2, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':9e3f85b') +Article.create!(name: 'Hazel bruin', supplier_id: 4, article_category_id: 13, unit: 'kg', note: 'bio', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':d278041') +Article.create!(name: 'Amandel Bruin Spaans', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'bio', availability: true, price: 0.999E1, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':0b51a8d') +Article.create!(name: 'Paranoten (bio)', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'bio', availability: true, price: 0.6666E2, tax: 6.0, deposit: 0.0, unit_quantity: 20, order_number: ':01e59e3') +Article.create!(name: 'Bio walnoten light halfjes', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'bio', availability: true, price: 0.333E1, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':7ff8587') +Article.create!(name: 'Pijnboompitten', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'bio', availability: true, price: 0.888E1, tax: 6.0, deposit: 0.0, unit_quantity: 25, order_number: ':aa88d9f') +Article.create!(name: 'Pompoen', supplier_id: 4, article_category_id: 13, unit: 'kg', note: 'bio', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 25, order_number: ':e63069b') +Article.create!(name: 'Zonnepitten (bio)', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'bio', availability: true, price: 0.999E1, tax: 6.0, deposit: 0.0, unit_quantity: 25, order_number: ':0428388') +Article.create!(name: 'Amandel Wit Spaans', supplier_id: 4, article_category_id: 13, unit: 'kg', + note: 'bio', availability: true, price: 0.66666E3, tax: 6.0, deposit: 0.0, unit_quantity: 10, order_number: ':a8f0734') +Article.create!(name: 'Cashew', supplier_id: 4, article_category_id: 13, unit: 'kg', availability: true, + price: 0.6666E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':1d26958') +Article.create!(name: 'Amandelen geblancheerd', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.333E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':31439e2') +Article.create!(name: 'Amandelen naturel', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':9c49374') +Article.create!(name: 'Walnoot ELH hafjes', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.4444E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':92907d1') +Article.create!(name: 'Walnoot ELP stukjes', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.8888E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':395640e') +Article.create!(name: 'Paranoten', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.8888E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':710acbb') +Article.create!(name: 'Macadamia Stijl 0', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.3333E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':bbaf40b') +Article.create!(name: 'Pecan', supplier_id: 4, article_category_id: 13, unit: 'kg', availability: true, + price: 0.55555E3, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':7958183') +Article.create!(name: 'Hazelnoten naturel', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.6666E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':50392a8') +Article.create!(name: 'Hazelnoten geblancheerd', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.3333E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':4fe6525') +Article.create!(name: 'Gemengde Noten', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.333E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':c051b22') +Article.create!(name: "Pinda's", supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.777E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':f507577') +Article.create!(name: "Vliespinda's klein", supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.8888E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':ce563bb') +Article.create!(name: 'Medjoul dadels', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.3333E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':8232061') +Article.create!(name: 'Turkse Abrikozen ongezwaveld', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.888E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':185084f') +Article.create!(name: 'Turkse Abrikozen gezwaveld', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':2b2fb20') +Article.create!(name: 'Spaanse Vijgen', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.444E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':82590b1') +Article.create!(name: 'Turkse Vijgen', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.555E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':cabeeb6') +Article.create!(name: 'Zure Abrikozen Zuid Afrika', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':2ac18b7') +Article.create!(name: 'Blauwe rozijnen Flames', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':16bfa75') +Article.create!(name: 'Gele Rozijnen', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.2222E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':1c59324') +Article.create!(name: 'Rode Rozijnen', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.1111E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':c3fcd84') +Article.create!(name: 'Cranberries heel', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.222E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':921c168') +Article.create!(name: 'Gedroogde Appeltjes', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.555E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':902c67b') +Article.create!(name: 'Gedroogde pruimen zonder pit', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.222E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':a847f91') +Article.create!(name: 'Pompoenpitten', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.111E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':535645f') +Article.create!(name: 'Zonnenbloepitten', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.666E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':4ab9a83') +Article.create!(name: 'Lijnzaad', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.55E0, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':04be223') +Article.create!(name: 'Maanzaad', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.7777E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':ec5b2b9') +Article.create!(name: 'Pijnboompitten medium china', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.2222E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':0e5b0b8') +Article.create!(name: 'Goji bessen', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.888E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':d52ee00') +Article.create!(name: 'Mulberries', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.5555E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':5f46bd5') +Article.create!(name: 'Gepelde Hennep', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.5555E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':c39165b') +Article.create!(name: 'Incaberries', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.888E1, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':8d44fe7') +Article.create!(name: 'Blueberries', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.2222E2, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':9a95422') +Article.create!(name: 'Chia zaad', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.55555E3, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':416d57b') +Article.create!(name: 'Cocos Rasp', supplier_id: 4, article_category_id: 13, unit: 'kg', + availability: true, price: 0.55E0, tax: 6.0, deposit: 0.0, unit_quantity: 1, order_number: ':b3f65e4') ## Members & groups -User.create!(:id => 1, :nick => "admin", :password => "secret", :first_name => "Anton", :last_name => "Administrator", :email => "admin@foo.test", :created_on => 'Wed, 15 Jan 2014 16:15:33 UTC +00:00') -User.create!(:id => 2, :nick => "john", :password => "secret", :first_name => "John", :last_name => "Doe", :email => "john@doe.test", :created_on => 'Sun, 19 Jan 2014 17:38:22 UTC +00:00') -User.create!(:id => 3, :nick => "peter", :password => "secret", :first_name => "Peter", :last_name => "Pieterssen", :email => "peter@pieterssen.test", :created_on => 'Sat, 25 Jan 2014 20:20:36 UTC +00:00') -User.create!(:id => 4, :nick => "jan", :password => "secret", :first_name => "Jan", :last_name => "Klaassen", :email => "jan@klaassen.test", :created_on => 'Mon, 27 Jan 2014 16:22:14 UTC +00:00') -User.create!(:id => 5, :nick => "mary", :password => "secret", :first_name => "Marie", :last_name => "Klaassen", :email => "mary@klaassen.test", :created_on => 'Mon, 03 Feb 2014 11:47:17 UTC +00:00') +User.create!(id: 1, nick: 'admin', password: 'secret', first_name: 'Anton', last_name: 'Administrator', + email: 'admin@foo.test', created_on: 'Wed, 15 Jan 2014 16:15:33 UTC +00:00') +User.create!(id: 2, nick: 'john', password: 'secret', first_name: 'John', last_name: 'Doe', + email: 'john@doe.test', created_on: 'Sun, 19 Jan 2014 17:38:22 UTC +00:00') +User.create!(id: 3, nick: 'peter', password: 'secret', first_name: 'Peter', last_name: 'Pieterssen', + email: 'peter@pieterssen.test', created_on: 'Sat, 25 Jan 2014 20:20:36 UTC +00:00') +User.create!(id: 4, nick: 'jan', password: 'secret', first_name: 'Jan', last_name: 'Klaassen', + email: 'jan@klaassen.test', created_on: 'Mon, 27 Jan 2014 16:22:14 UTC +00:00') +User.create!(id: 5, nick: 'mary', password: 'secret', first_name: 'Marie', last_name: 'Klaassen', + email: 'mary@klaassen.test', created_on: 'Mon, 03 Feb 2014 11:47:17 UTC +00:00') -Workgroup.create!(:id => 1, :name => "Admins", :description => "Beheerders", :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 => "Financiën", :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) -Workgroup.create!(:id => 3, :name => "Bestellen", :account_balance => 0.0, :created_on => 'Thu, 20 Feb 2014 14:44:47 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => true, :role_finance => false, :role_orders => true, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false) -Workgroup.create!(:id => 4, :name => "Assortiment", :account_balance => 0.0, :created_on => 'Wed, 09 Apr 2014 12:24:55 UTC +00:00', :role_admin => false, :role_suppliers => true, :role_article_meta => true, :role_finance => false, :role_orders => false, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false) -Ordergroup.create!(:id => 5, :name => "Admin Administrator", :account_balance => 0.0, :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 => 6, :name => "Peter's huis", :account_balance => -0.35E2, :created_on => 'Sat, 25 Jan 2014 20:20:37 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => false, :role_finance => false, :role_orders => false, :contact_person => "Piet Pieterssen", :stats => { :jobs_size => 0, :orders_sum => 60.96 }, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false) -Ordergroup.create!(:id => 7, :name => "Jan Klaassen", :account_balance => -0.35E2, :created_on => 'Mon, 27 Jan 2014 16:22:14 UTC +00:00', :role_admin => false, :role_suppliers => false, :role_article_meta => false, :role_finance => false, :role_orders => false, :contact_person => "Jan Klaassen", :stats => { :jobs_size => 0, :orders_sum => 0 }, :next_weekly_tasks_number => 8, :ignore_apple_restriction => false) -Ordergroup.create!(:id => 8, :name => "John Doe", :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) +Workgroup.create!(id: 1, name: 'Admins', description: 'Beheerders', 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: 'Financiën', 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) +Workgroup.create!(id: 3, name: 'Bestellen', account_balance: 0.0, + created_on: 'Thu, 20 Feb 2014 14:44:47 UTC +00:00', role_admin: false, role_suppliers: false, role_article_meta: true, role_finance: false, role_orders: true, next_weekly_tasks_number: 8, ignore_apple_restriction: false) +Workgroup.create!(id: 4, name: 'Assortiment', account_balance: 0.0, + created_on: 'Wed, 09 Apr 2014 12:24:55 UTC +00:00', role_admin: false, role_suppliers: true, role_article_meta: true, role_finance: false, role_orders: false, next_weekly_tasks_number: 8, ignore_apple_restriction: false) +Ordergroup.create!(id: 5, name: 'Admin Administrator', account_balance: 0.0, + 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: 6, name: "Peter's huis", account_balance: -0.35E2, + created_on: 'Sat, 25 Jan 2014 20:20:37 UTC +00:00', role_admin: false, role_suppliers: false, role_article_meta: false, role_finance: false, role_orders: false, contact_person: 'Piet Pieterssen', stats: { jobs_size: 0, orders_sum: 60.96 }, next_weekly_tasks_number: 8, ignore_apple_restriction: false) +Ordergroup.create!(id: 7, name: 'Jan Klaassen', account_balance: -0.35E2, + created_on: 'Mon, 27 Jan 2014 16:22:14 UTC +00:00', role_admin: false, role_suppliers: false, role_article_meta: false, role_finance: false, role_orders: false, contact_person: 'Jan Klaassen', stats: { jobs_size: 0, orders_sum: 0 }, next_weekly_tasks_number: 8, ignore_apple_restriction: false) +Ordergroup.create!(id: 8, name: 'John Doe', 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) -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) -Membership.create!(:group_id => 6, :user_id => 3) -Membership.create!(:group_id => 7, :user_id => 4) -Membership.create!(:group_id => 8, :user_id => 4) -Membership.create!(:group_id => 3, :user_id => 4) -Membership.create!(:group_id => 7, :user_id => 5) -Membership.create!(:group_id => 3, :user_id => 5) -Membership.create!(:group_id => 4, :user_id => 5) +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) +Membership.create!(group_id: 6, user_id: 3) +Membership.create!(group_id: 7, user_id: 4) +Membership.create!(group_id: 8, user_id: 4) +Membership.create!(group_id: 3, user_id: 4) +Membership.create!(group_id: 7, user_id: 5) +Membership.create!(group_id: 3, user_id: 5) +Membership.create!(group_id: 4, user_id: 5) ## Orders & OrderArticles @@ -181,10 +308,15 @@ seed_group_orders ## Finances -FinancialTransactionType.create!(:id => 1, :name => "Foodcoop", :financial_transaction_class_id => 1) +FinancialTransactionType.create!(id: 1, name: 'Foodcoop', financial_transaction_class_id: 1) -FinancialTransaction.create!(:id => 1, :ordergroup_id => 5, :amount => -0.35E2, :note => "Membership fee for ordergroup", :user_id => 1, :created_on => 'Sat, 18 Jan 2014 00:38:48 UTC +00:00', :financial_transaction_type_id => 1) -FinancialTransaction.create!(:id => 3, :ordergroup_id => 6, :amount => -0.35E2, :note => "Membership fee for ordergroup", :user_id => 1, :created_on => 'Sat, 25 Jan 2014 20:20:37 UTC +00:00', :financial_transaction_type_id => 1) -FinancialTransaction.create!(:id => 4, :ordergroup_id => 7, :amount => -0.35E2, :note => "Membership fee for ordergroup", :user_id => 1, :created_on => 'Mon, 27 Jan 2014 16:22:14 UTC +00:00', :financial_transaction_type_id => 1) -FinancialTransaction.create!(:id => 5, :ordergroup_id => 5, :amount => 0.35E2, :note => "payment", :user_id => 2, :created_on => 'Wed, 05 Feb 2014 16:49:24 UTC +00:00', :financial_transaction_type_id => 1) -FinancialTransaction.create!(:id => 6, :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) +FinancialTransaction.create!(id: 1, ordergroup_id: 5, amount: -0.35E2, + note: 'Membership fee for ordergroup', user_id: 1, created_on: 'Sat, 18 Jan 2014 00:38:48 UTC +00:00', financial_transaction_type_id: 1) +FinancialTransaction.create!(id: 3, ordergroup_id: 6, amount: -0.35E2, + note: 'Membership fee for ordergroup', user_id: 1, created_on: 'Sat, 25 Jan 2014 20:20:37 UTC +00:00', financial_transaction_type_id: 1) +FinancialTransaction.create!(id: 4, ordergroup_id: 7, amount: -0.35E2, + note: 'Membership fee for ordergroup', user_id: 1, created_on: 'Mon, 27 Jan 2014 16:22:14 UTC +00:00', financial_transaction_type_id: 1) +FinancialTransaction.create!(id: 5, ordergroup_id: 5, amount: 0.35E2, note: 'payment', user_id: 2, + created_on: 'Wed, 05 Feb 2014 16:49:24 UTC +00:00', financial_transaction_type_id: 1) +FinancialTransaction.create!(id: 6, 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) diff --git a/demo_day_nks.bnn b/demo_day_nks.bnn deleted file mode 100644 index 9bb9c733..00000000 --- a/demo_day_nks.bnn +++ /dev/null @@ -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;; \ No newline at end of file diff --git a/deployment/.env.sample b/deployment/.env.sample deleted file mode 100644 index a0d398c6..00000000 --- a/deployment/.env.sample +++ /dev/null @@ -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='example hosted by Your Tech Co-op.' -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 diff --git a/deployment/app_config.yml.tmpl b/deployment/app_config.yml.tmpl deleted file mode 100644 index f1e1a580..00000000 --- a/deployment/app_config.yml.tmpl +++ /dev/null @@ -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: | - # - # ...... - - # 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 diff --git a/deployment/compose.yml b/deployment/compose.yml deleted file mode 100644 index 50543ba4..00000000 --- a/deployment/compose.yml +++ /dev/null @@ -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 diff --git a/deployment/database.yml.tmpl b/deployment/database.yml.tmpl deleted file mode 100644 index bf64dc72..00000000 --- a/deployment/database.yml.tmpl +++ /dev/null @@ -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" }}" diff --git a/deployment/entrypoint.sh.tmpl b/deployment/entrypoint.sh.tmpl deleted file mode 100644 index 06f27b08..00000000 --- a/deployment/entrypoint.sh.tmpl +++ /dev/null @@ -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 diff --git a/doc/SETUP_DEVELOPMENT.md b/doc/SETUP_DEVELOPMENT.md index 319c2787..ac086416 100644 --- a/doc/SETUP_DEVELOPMENT.md +++ b/doc/SETUP_DEVELOPMENT.md @@ -12,7 +12,7 @@ If instead you just want to run Foodsoft without changing its code, please refer **System requirements**: [rbenv](https://github.com/rbenv/rbenv), -[Ruby 2.6+](https://www.ruby-lang.org/en/downloads/), +[Ruby 2.7+](https://www.ruby-lang.org/en/downloads/), [Bundler](http://bundler.io/), [MySQL](http://mysql.com/) / [SQLite](http://sqlite.org/), [Redis](http://redis.io/) (optional). @@ -32,6 +32,10 @@ If instead you just want to run Foodsoft without changing its code, please refer Have a look how to avoid that in the [Docker Development Setup](./SETUP_DEVELOPMENT_DOCKER.md#prerequisites-windows-only) instructions. +1. Install developement packages. For Debian/Ubuntu: + + sudo apt install default-libmysqlclient-dev libmagic-dev libxml2-dev libxslt-dev + 1. Install and setup rbenv and Bundler. For Debian/Ubuntu: sudo apt install rbenv @@ -175,4 +179,4 @@ within a docker image. While the default [`Dockerfile`](../Dockerfile) is setup use docker-compose (using [`docker-compose-dev.yml`](../docker-compose-dev.yml)) to setup the whole stack at once. -See [Setup Development Docker](./SETUP_DEVELOPMENT_DOCKER.md) for a detailed description. \ No newline at end of file +See [Setup Development Docker](./SETUP_DEVELOPMENT_DOCKER.md) for a detailed description. diff --git a/doc/foodcoop-explained.jpg b/doc/foodcoop-explained.jpg deleted file mode 100644 index 723204f2..00000000 Binary files a/doc/foodcoop-explained.jpg and /dev/null differ diff --git a/doc/logo-bmbf.svg b/doc/logo-bmbf.svg deleted file mode 100644 index 228001de..00000000 --- a/doc/logo-bmbf.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/doc/logo-okfn.svg b/doc/logo-okfn.svg deleted file mode 100644 index 035d7a5d..00000000 --- a/doc/logo-okfn.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/doc/screenshots/balance_sum.png b/doc/screenshots/balance_sum.png deleted file mode 100644 index db2f9033..00000000 Binary files a/doc/screenshots/balance_sum.png and /dev/null differ diff --git a/doc/screenshots/bnn_upload.png b/doc/screenshots/bnn_upload.png deleted file mode 100644 index b22dedd8..00000000 Binary files a/doc/screenshots/bnn_upload.png and /dev/null differ diff --git a/doc/screenshots/custom_csv_export.png b/doc/screenshots/custom_csv_export.png deleted file mode 100644 index ba7e12bc..00000000 Binary files a/doc/screenshots/custom_csv_export.png and /dev/null differ diff --git a/doc/screenshots/message_formatting.png b/doc/screenshots/message_formatting.png deleted file mode 100644 index 0c80c200..00000000 Binary files a/doc/screenshots/message_formatting.png and /dev/null differ diff --git a/doc/screenshots/order.png b/doc/screenshots/order.png deleted file mode 100644 index fd6e0e7c..00000000 Binary files a/doc/screenshots/order.png and /dev/null differ diff --git a/doc/screenshots/rswag.png b/doc/screenshots/rswag.png deleted file mode 100644 index b94bd581..00000000 Binary files a/doc/screenshots/rswag.png and /dev/null differ diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index b0a325db..0a8b3fec 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -11,7 +11,6 @@ services: build: context: . dockerfile: Dockerfile-dev - platform: linux/x86_64 command: ./proc-start worker volumes: - bundle:/usr/local/bundle diff --git a/lib/tasks/foodsoft.rake b/lib/tasks/foodsoft.rake index 760cd5bc..caa54a1a 100644 --- a/lib/tasks/foodsoft.rake +++ b/lib/tasks/foodsoft.rake @@ -1,61 +1,61 @@ # put in here all foodsoft tasks # => :environment loads the environment an gives easy access to the application -namespace :foodsoft do - desc "Finish ended orders" - task :finish_ended_orders => :environment do +namespace :foodsoft do # rubocop:disable Metrics/BlockLength + desc 'Finish ended orders' + task finish_ended_orders: :environment do Order.finish_ended! end - desc "Notify users of upcoming tasks" - task :notify_upcoming_tasks => :environment do + desc 'Notify users of upcoming tasks' + task notify_upcoming_tasks: :environment do tasks = Task.where(done: false, due_date: 1.day.from_now.to_date) for task in tasks rake_say "Send notifications for #{task.name} to .." for user in task.users - if user.settings.notify['upcoming_tasks'] - Mailer.deliver_now_with_user_locale user do - Mailer.upcoming_tasks(user, task) - end + next unless user.settings.notify['upcoming_tasks'] + + Mailer.deliver_now_with_user_locale user do + Mailer.upcoming_tasks(user, task) end end end end - desc "Notify workgroup of upcoming weekly task" - task :notify_users_of_weekly_task => :environment do - tasks = Task.where(done: false, due_date: 7.day.from_now.to_date) + desc 'Notify workgroup of upcoming weekly task' + task notify_users_of_weekly_task: :environment do + tasks = Task.where(done: false, due_date: 7.days.from_now.to_date) for task in tasks - unless task.enough_users_assigned? - workgroup = task.workgroup - if workgroup - rake_say "Notify workgroup: #{workgroup.name} for task #{task.name}" - for user in workgroup.users - if user.receive_email? - Mailer.deliver_now_with_user_locale user do - Mailer.not_enough_users_assigned(task, user) - end - end - end + next if task.enough_users_assigned? + + workgroup = task.workgroup + next unless workgroup + + rake_say "Notify workgroup: #{workgroup.name} for task #{task.name}" + for user in workgroup.users + next unless user.receive_email? + + Mailer.deliver_now_with_user_locale user do + Mailer.not_enough_users_assigned(task, user) end end end end - desc "Create upcoming periodic tasks" - task :create_upcoming_periodic_tasks => :environment do + desc 'Create upcoming periodic tasks' + task create_upcoming_periodic_tasks: :environment do for tg in PeriodicTaskGroup.all created_until = tg.create_tasks_for_upfront_days rake_say "created until #{created_until}" end end - desc "Parse incoming email on stdin (options: RECIPIENT=foodcoop.handling)" - task :parse_reply_email => :environment do + desc 'Parse incoming email on stdin (options: RECIPIENT=foodcoop.handling)' + task parse_reply_email: :environment do FoodsoftMailReceiver.received ENV.fetch('RECIPIENT', nil), STDIN.read end - desc "Start STMP server for incoming email (options: SMTP_SERVER_PORT=2525, SMTP_SERVER_HOST=0.0.0.0)" - task :reply_email_smtp_server => :environment do + desc 'Start STMP server for incoming email (options: SMTP_SERVER_PORT=2525, SMTP_SERVER_HOST=0.0.0.0)' + task reply_email_smtp_server: :environment do port = ENV['SMTP_SERVER_PORT'].present? ? ENV['SMTP_SERVER_PORT'].to_i : 2525 host = ENV.fetch('SMTP_SERVER_HOST', nil) rake_say "Started SMTP server for incoming email on port #{port}." @@ -64,8 +64,8 @@ namespace :foodsoft do server.join end - desc "Import and assign bank transactions" - task :import_and_assign_bank_transactions => :environment do + desc 'Import and assign bank transactions' + task import_and_assign_bank_transactions: :environment do BankAccount.find_each do |ba| importer = ba.find_connector next unless importer @@ -79,6 +79,19 @@ namespace :foodsoft do rake_say "#{ba.name}: imported #{importer.count}, assigned #{assign_count}" end end + + desc 'Prune attachments older than maximum age' + task prune_old_attachments: :environment do + if FoodsoftConfig[:attachment_retention_days] + rake_say "Pruning attachments older than #{FoodsoftConfig[:attachment_retention_days]} days" + ActiveStorage::Attachment.where("created_at < ?", FoodsoftConfig[:attachment_retention_days].days.ago).each do |attachment| + rake_say attachment.inspect + attachment.purge_later + end + else + rake_say "Please configure your app_config.yml accordingly:\nattachment_retention_days:Bitte überprufe die engelesenen Artikel.
Achtung, momentan gibt es keine Überprüfung auf doppelte Artikel.
" + submit: Hochladen + title: Artikel hochladen + sync: + outlist: + alert_used: Achtung, %{article} wird gerade in einer laufenden Bestellung verwendet. Bitte erst Bestellung anpassen. + body: 'Folgende Artikel wurden ausgelistet und werden gelöscht:' + body_ignored: + one: Ein Artikel ohne Bestellnummer wurde übersprungen. + other: "%{count} Artikel ohne Bestellnummer wurden übersprungen." + body_skip: Es müssen keine Artikel gelöscht werden. + title: Auslisten ... + price_short: Preis + submit: Alle synchronisieren + title: Artikel mit externer Datenbank synchronisieren + unit_quantity_short: GebGr + update: + body: 'Jeder Artikel wird doppelt angezeigt: die alten Werte sind grau und die Textfelder sind mit den aktuellen Werten vorausgefüllt. Abweichungen zu den alten Artikeln sind gelb markiert.' + title: Aktualisieren ... + update_msg: + one: Ein Artikel muss aktualisiert werden. + other: "%{count} Artikel müssen aktualisiert werden." + upnew: + body_count: + one: Es gibt einen neuen Artikel hinzuzufügen. + other: Es gibt %{count} Artikel hinzuzufügen. + title: Neue hinzufügen ... + upload: + fields: + reserved: "(geschützt)" + status: Status (x=ausgelistet) + file_label: Bitte wähle eine kompatible Datei aus + options: + convert_units: Derzeitige Einheiten beibehalten, berechne Mengeneinheit und Preis (wie Synchronisieren). + outlist_absent: Artikel löschen, die nicht in der hochgeladenen Datei sind. + sample: + juices: Säfte + nuts: Nüsse + organic: Bio + supplier_1: Nussfarm + supplier_2: Braune Felder + supplier_3: Grüne Felder + tomato_juice: Tomatensaft + walnuts: Walnüsse + submit: Datei hochladen + text_1: 'Du kannst hier eine Tabelle hochladen, um die Artikel des Lieferanten %{supplier} zu aktualisieren. Excel (xls, xlsx) und OpenOffice (ods) Tabellen werden akzeptiert, darüber hinaus Dateien im Format "csv" (comma-separated values, mit dem Spaltentrennzeichen ";" und utf-8 Kodierung). Nur das erste Tabellenblatt wird importiert und die Spalten müssen in der folgenden Anordnung vorliegen:' + text_2: Die hier gezeigten Spalten sind Beispiele. Ist ein "x" in der ersten Spalte, wird der Artikel aussortiert und entfernt. Das erlaubt Dir die Tabelle zu ändern und schnell viele Artikel auf ein Mal zu entfernen, zum Beispiel wenn Artkiel des Lieferanten nicht mehr verfügbar sind. Die Kategorie wird der Foodsoft Kategorie zugeordnet (durch die Kategorienamen und die Importnamen). + title: Artikel des Lieferanten %{supplier} hochladen + bank_account_connector: + confirm: Bitte bestätige den Code %{code}. + fields: + email: E-Mail + pin: PIN + password: Passwort + tan: TAN + username: Benutzername + config: + hints: + applepear_url: Seite, auf der das Äpfel- und Birnensystem für Aufgaben erklärt wird. + charge_members_manually: Wann die Aufzeichnungen über was wer bekommen hat wo anders (z.B. auf Papier) geführt werden und nicht in die Foosoft eingetragen werden, sollte diese Option aktiviert werden. Die Abrechnung muss dann manuell (mittels "Neue Überweisungen eingeben") eingetragen werden. Bestellungen müssen nach wie vor abgerechnet werden, aber das belastet nicht die Konten der Mitglieder. + contact: + email: E-Mail Adresse zur allgemeinen Kontaktaufnahme, die auf der Webseite und in einigen Formularen gezeigt wird. + street: Anschrift; üblicherweise ist dies Euer Liefer- und Abholort. + currency_space: Leerzeichen beim Währungssymbol hinzufügen. + currency_unit: Währungssymbol zur Anzeige von Preisen. + custom_css: Um das Layout der Seite anzupassen, kannst Du CSS verwenden. Kann leer gelassen werden, um den Standard Stil zu verwenden. + email_from: E-Mails werden so aussehen, als ob sie von dieser Adresse gesendet wurden. Kann leer gelassen werden, um die Kontaktadresse der Foodcoop zu benutzen. + email_replyto: Setze diese Adresse, wenn Du Antworten auf Foodsoft E-Mails auf eine andere, als die oben angegebene Absenderadresse bekommen möchtest. + email_sender: E-Mails werden so aussehen, als ob sie von dieser Adresse versendet wurden. Um zu vermeiden, dass E-Mails dadurch als Spam eingeordnet werden, muss der Webserver möglicherweise im SPF Eintrag der Domain der E-Mail Adresse eingetragen werden. + group_order_invoices: + use_automativ_go_invoices: Es werden auf die Bestellgruppen zugeschnittene Rechnungen für die jeweilige Bestellung beim Klicken auf "abrechnen" an alle Bestellgruppenmitglieder per Mail versendet. + payment_method: Zahlungsart wird auf der Bestellgruppenrechnung deklariert + vat_exempt: Eine Auflistung der Rechnungsartikel erfolgt ohne explizite Ausweisung der MwSt. und die Rechnung erhält den notwendigen Zusatz bzgl. der Kleinunternehmerregelung §19 (FoodCoop Marge ebenfalls nicht in Rechnung enthalten) + help_url: Link zur Dokumentationsseite + homepage: Webseite der Foodcoop + ignore_browser_locale: Ignoriere die Sprache des Computers des Anwenders, wenn der Anwender noch keine Sprache gewählt hat. + minimum_balance: Mitglieder können nur bestellen, wenn ihr Kontostand mindestens diesem Betrag entspricht. + name: Der Name Deiner Foodcoop + order_schedule: + boxfill: + recurr: Standarddatum für den Begin der Kistenauffüllphase + time: Standardzeit für den Begin der Kistenauffüllphase + ends: + recurr: Standarddatum für den Bestellschluss + time: Standardzeit für den Bestellschluss + initial: Bestellungen starten an diesem Datum + page_footer: Dies wird in der Fußzeile jeder Seite angezeigt. Wird es leer gelassen, wird die Fußzeile komplett deaktiviert. + pdf_add_page_breaks: + order_by_articles: Jeden Artikel auf eine eigene Seite bringen + order_by_groups: Jede Bestellgruppe auf eine eigene Seite bringen + pdf_font_size: Standardmäßige Schriftgröße für PDF Dokumente (12 ist der Standardwert) + pdf_page_size: Seitengröße für PDF Dokumente, normalerweise "A4" + price_markup: Prozentsatz, welcher als Aufschlag auf alle Preise addiert wird + stop_ordering_under: Mitglieder können nur bestellen, wenn sie mindestens diese Anzahl von Apfel-Punkten haben. + tasks_period_days: Anzahl der Tage zwischen Bestellungen (Standard 7 - für eine Woche) + tasks_upfront_days: Anzahl der Tage, für welche du im Voraus wiederkehrende Aufgaben definieren möchtest + tax_default: Standard Mehrwertsteuersatz für neue Artikel + tolerance_is_costly: Eine möglichst große Menge im Rahmen der Tolerenz bestellen. Wenn dies nicht aktiviert ist, wird im Rahmen der Toleranz nur so viel bestellt, dass damit komplette Einheiten (Boxen) bestellt werden können. Die Option wirkt sich auch auf die Toleranz des Gesamtpreises einer offenen Mitgliederbestellung aus. + distribution_strategy: Wie bei der Verteilung von Artikeln nach dem Empfangen einer Bestellung vorgegangen werden soll. + use_apple_points: Wenn das Apfel Punktesystem aktiviert ist, ist es erforderlich, dass Mitglieder Aufgaben erledigen um bestellen zu können. + use_boxfill: Wenn aktiviert, können Benutzer nahe am Ende der Bestellung diese nur mehr so verändern, dass sich die Gesamtsumme erhöht. Dies hilft beim auffüllen der verbleibenden Kisten. Es muss trotzdem noch das Kistenauffülldatum bei der Bestellung gesetzt werden. + use_iban: Zusätzlich Feld für die internationale Kontonummer bei Benutzern und Lieferanten anzeigen + use_nick: Benutzernamen anstatt reale Namen zeigen und verwenden, jeder Benutzer muss dazu einen Benutzernamen (Spitznamen) haben. + use_self_service: Wenn aktiviert, können Benutzer_innen selbständig dafür freigegebene Abrechungsfunktionen nutzen. + webstats_tracking_code: Tracking Code für Webseitenanalyse (wie Piwik oder Google Analytics), leer lassen wenn keine Analyse erfolgt + keys: + applepear_url: Hilfe URL für das Äpfel Punktesystem zum Engagement + charge_members_manually: Mitglieder manuell abrechnen + contact: + city: Stadt + country: Land + email: E-Mail + phone: Telefon + street: Straße + zip_code: Postleitzahl + tax_number: Steuernummer + currency_space: Leerzeichen hinzufügen + currency_unit: Währung + custom_css: Angepasstes CSS + default_locale: Standardsprache + default_role_article_meta: Artikeldatenbank + default_role_finance: Finanzen + default_role_invoices: Rechnungen + default_role_orders: Bestellverwaltung + default_role_pickups: Abholtage + default_role_suppliers: Lieferanten + disable_invite: Einladungen deaktivieren + disable_members_overview: Mitgliederliste deaktivieren + email_from: Absenderadresse + email_replyto: Antwortadresse + email_sender: Senderadresse + group_order_invoices: + use_automatic_invoices: Automatisch bei Abrechnung per Mail versenden + separate_deposits: Pfand getrennt abrechnen + payment_method: Zahlungsart + vat_exempt: Diese Foodcoop ist MwSt. befreit + help_url: URL Dokumentation + homepage: Webseite + ignore_browser_locale: Browsersprache ignorieren + minimum_balance: Minimaler Kontostand + name: Name + order_schedule: + boxfill: + recurr: Kistenauffüllen ab + time: Zeit + ends: + recurr: Bestellschluss + time: Zeit + initial: Bestellstart + page_footer: Fußzeile Webseite + pdf_add_page_breaks: Seitenwechsel + pdf_font_size: Schriftgrösse + pdf_page_size: Seitenformat + price_markup: Foodcoop Marge + stop_ordering_under: Apfelpunkte Minimum + tasks_period_days: Zeitintervall + tasks_upfront_days: Im Voraus + tax_default: Mehrwertsteuer + time_zone: Zeitzone + tolerance_is_costly: Bestelltoleranz maximal ausnutzen, um möglichst große Mengen zu bestellen + distribution_strategy: Verteilungs-Strategie + distribution_strategy_options: + first_order_first_serve: Zuerst an die verteilen, die zuerst bestellt haben + no_automatic_distribution: Keine automatische Verteilung + use_apple_points: Apfelpunkte verwenden + use_boxfill: Kistenauffüllphase + use_iban: IBAN verwenden + use_nick: Benutzernamen verwenden + use_self_service: Selbstbedienung verwenden + webstats_tracking_code: Code für Websiteanalysetool + tabs: + applications: Apps + foodcoop: Foodcoop + language: Sprache + layout: Layout + list: Liste + messages: Nachrichten + others: Sonstiges + payment: Finanzen + security: Sicherheit + tasks: Aufgaben + deliveries: + add_stock_change: + how_many_units: 'Wie viele Einheiten (%{unit}) des Artikels »%{name}« liefern?' + create: + notice: Lieferung wurde erstellt. Bitte nicht vergessen die Rechnung anzulegen! + destroy: + notice: Lieferung wurde gelöscht. + edit: + title: Lieferung bearbeiten + form: + confirm_foreign_supplier_reedit: Der Lagerartikel »%{name}« wurde erfolgreich gespeichert. Er gehört jedoch nicht zu dem Lieferanten dieser Lieferung. Möchtest Du diesen Lagerartikel erneut bearbeiten? + create_from_blank: Ohne Vorlage anlegen + create_stock_article: Lagerartikel anlegen + title_fill_quantities: 2. Liefermenge angeben + title_finish_delivery: 3. Lieferung abschließen + title_select_stock_articles: 1. Lagerartikel auswählen + index: + confirm_delete: Bist Du sicher? + new_delivery: 'Neue Lieferung für %{supplier} anlegen' + title: "%{supplier}/Lieferungen" + invoice_amount: Rechnungsbetrag + invoice_net_amount: bereinigter Rechnungsbetrag + new: + title: Neue Lieferung von %{supplier} + show: + sum: Summe + sum_diff: Brutto - bereinigter Rechnungsbetrag + sum_gross: Bruttosumme + sum_net: Nettosumme + title: Lieferung anzeigen + title_articles: Artikel + stock_article_for_adding: + action_add_to_delivery: Liefern + action_edit: Bearbeiten + action_other_price: Kopieren + stock_change_fields: + remove_article: Artikel aus Lieferung entfernen + suppliers_overview: Lieferantenübersicht + update: + notice: Lieferung wurde aktualisiert. + documents: + group_order_invoice_pdf: + filename: Rechnung%{number} + invoicer: Rechnungsteller*in + invoicee: Rechnungsempfänger*in + invoice_date: 'Rechnungsdatum: %{invoice_date}' + invoice_number: 'Rechnungsnummer: %{invoice_number}' + markup_included: zzgl. Foodcoop Marge auf brutto Preis %{marge}% + ordergroup: + contact_phone: 'Telefonnummer: %{contact_phone}' + contact_address: 'Adresse : %{contact_address}' + customer_number: 'Kundennummer: %{customer_number}' + name: Bestellgruppe %{ordergroup} + payment_method: 'Zahlungsart: %{payment_method}' + sum_to_pay: Zu zahlen gesamt + sum_to_pay_net: Zu zahlen gesamt (netto) + sum_to_pay_gross: Gesamt + small_business_regulation: Als Kleinunternehmer*in im Sinne von §19 Abs. 1 Umsatzsteuergesetz (UStG) wird keine Umsatzsteuer berechnet. + table_headline: 'Für die Bestellung fallen folgende Posten an:' + tax_excluded: exkl. MwSt. + tax_included: zzgl. Gesamtsumme MwSt. %{tax}% + tax_number: 'Steuernummer: %{number}' + title: Rechnung für die Bestellung bei %{supplier} + vat_exempt_rows: + - Name + - Anzahl + - Einzelpreis + - Artikel Gesamtpreis + no_price_markup_rows: + - Name + - Anzahl + - Einzelpreis (netto) + - Artikel Gesamtpreis (netto) + - MwSt. + - Artikel Gesamtpreis (brutto) + price_markup_rows: + - Name + - Anzahl + - Einzelpreis (netto) + - Artikel Gesamtpreis (netto) + - MwSt. + - Artikel Gesamtpreis (brutto) inkl. Foodcoopmarge %{marge}% + order_by_articles: + filename: Bestellung %{name}-%{date} - Artikelsortierung + title: 'Artikelsortierung der Bestellung: %{name}, beendet am %{date}' + order_by_groups: + filename: Bestellung %{name}-%{date} - Gruppensortierung + sum: Summe + title: 'Gruppensortierung der Bestellung: %{name}, beendet am %{date}' + order_fax: + filename: Bestellung %{name}-%{date} - Fax + rows: + - BestellNr. + - Menge + - Name + - Gebinde + - Einheit + - Preis/Einheit + - Summe + total: Gesamtpreis + order_matrix: + filename: Bestellung %{name}-%{date} - Sortiermatrix + heading: Artikelübersicht (%{count}) + title: 'Sortiermatrix der Bestellung: %{name}, beendet am %{date}' + errors: + check_tax_number: Überprüft, ob die Steuernummer der Foodcoop richtig gesetzt ist + general: Ein Problem ist aufgetreten. + general_again: Ein Fehler ist aufgetreten. Bitte erneut versuchen. + general_msg: 'Ein Fehler ist aufgetreten: %{msg}' + internal_server_error: + text1: Ein unerwarteter Fehler ist aufgetreten. Entschuldigung! + text2: Wir wurden benachrichtigt. Fall das Problem weiterhin besteht, gib uns bitte bescheid. + title: Interner Server Fehler + not_found: + text: Diese Seite existiert anscheinend nicht. Entschuldigung! + title: Seite nicht gefunden + feedback: + create: + notice: Das Feedback wurde erfolgreich verschickt. Vielen Dank! + new: + first_paragraph: Fehler gefunden? Vorschlag? Idee? Kritik? Wir freuen uns über jegliches Feedback. + second_paragraph: Bitte beachte, dass das Foodsoft Team nur die Software wartet. Bei Fragen zur Organisation in Deiner Foodcoop, kontaktiere besser die entsprechenden Ansprechpartner. + send: Absenden + title: Gib Feedback + finance: + balancing: + close: + alert: 'Ein Fehler ist beim Abrechnen aufgetreten: %{message}' + notice: Bestellung wurde erfolgreich abgerechnet, die Kontostände aktualisiert. + notice_mail: Bestellung wurde erfolgreich abgerechnet, die Kontostände aktualisiert. Außerdem wurden automatisch Rechnungen an die Bestellgruppenmitglieder geschickt. + settings_not_set: Keine Emails mit Bestellgruppenrechnungen versendet. Bitte überprüfe die Einstellungen. Steuernummer gesetzt? + close_all_direct_with_invoice: + notice: 'Es wurden %{count} Bestellung abgerechnet.' + close_direct: + alert: 'Bestellung kann nicht abgerechnet werden: %{message}' + notice: Bestellung wurde abgerechnet. + confirm: + clear: Abrechnen + first_paragraph: 'Wenn die Bestellung abgerechnet wird, werden ebenfalls alle Gruppenkonten aktualisiert.Hier kannst Du den Mitgliedern Deiner Foodcoop eine Nachricht schreiben. Damit Deine Kontaktdaten einzusehen sind, musst Du sie unter %{profile_link} freigeben.
" + ph_name: Name ... + ph_ordergroup: Bestellgruppe ... + profile_link: Einstellungen + title: Mitglieder + workgroups: + edit: + invite_link: hier + invite_new: Neue Mitglieder kannst du %{invite_link} einladen. + title: Gruppe bearbeiten + index: + body: "Das bearbeiten von Gruppen ist nur für Mitglieder der Gruppe möglich.
Wenn du einer Gruppe beitreten willst, dann schreib doch den Mitgliedern eine Nachricht.
Hier kannst Du jemanden einladen, der nicht Teil der Foodcoop ist, deiner Bestellgruppe %{group} beizutreten. Nachdem die Einladung angenommen wurde, wird die Person in der Lage sein, Artikel zu deiner Bestellung hinzuzufügen (und zu entfernen).
Dies ist eine praktische Funktion, um jemanden in die Foodcoop einzuladen oder mit mehreren Leuten in einem Haushalt zu bestellen.
" + title: Person einladen + new: + action: Einladung abschicken + body: "Hier kannst du eine Person in die Gruppe %{group} einladen, die noch nicht Mitglied der Foodcoop ist.
" + success: Benutzer/in wurde erfolgreich eingeladen. + js: + ordering: + confirm_change: Änderungen an dieser Bestellung gehen verloren, wenn zu einer anderen Bestellung gewechselt wird. Möchtest Du trotzdem wechseln? + trix_editor: + file_size_alert: Der Dateianhang ist zu groß! Die maximale Größe beträgt 512Mb + layouts: + email: + footer_1_separator: "--" + footer_2_foodsoft: 'Foodsoft: %{url}' + footer_3_homepage: 'Foodcoop: %{url}' + footer_4_help: 'Hilfe: %{url}' + help: 'Hilfe' + foodsoft: Foodsoft + footer: + revision: Revision %{revision} + header: + feedback: + desc: Fehler gefunden? Vorschlag? Idee? Kritik? + title: Feedback + help: Hilfe + logout: Abmelden + ordergroup: Meine Bestellgruppe + profile: Profil bearbeiten + reference_calculator: Zahlungsreferenz-Rechner + logo: "foodsoft" + lib: + render_pdf: + page: Seite %{number} von %{count} + login: + accept_invitation: + body: "Du bist eingeladen worden als Mitglied der Gruppe %{group} in der Foodcoop %{foodcoop} mitzumachen.
Wenn Du mitmachen möchtest, dann fülle bitte dieses Formular aus.
Deine Daten werden selbstverständlich nicht an Dritte, aus was auch immer für Gründen, weitergeben. Du kannst auch entscheiden, wieviel deiner persönlichen Daten für alle einsehbar sein sollen. 'Alle' bedeutet hier alle Foodcoop-Mitglieder. Die Administratoren haben aber jederzeit Zugriff auf deine Daten.
" + submit: Foodsoft Account erstellen + title: Einladung in die %{name} + controller: + accept_invitation: + notice: Herzlichen Glückwunsch, Dein Account wurde erstellt. Du kannst Dich nun einloggen. + error_group_invalid: Die Gruppe, in die Du eingeladen wurdest, existiert leider nicht mehr. + error_invite_invalid: Deine Einladung ist nicht (mehr) gültig. + error_token_invalid: Ungültiger oder abgelaufener Token. Bitte versuch es erneut. + reset_password: + notice: Wenn Deine E-Mail hier registiert ist bekommst Du jetzt eine Nachricht mit einem Passwort-Zurücksetzen-Link. + update_password: + notice: Dein Passwort wurde aktualisiert. Du kannst Dich jetzt anmelden. + forgot_password: + body: "Kein Problem, Du kannst dir einfach ein neues Passwort zulegen.
Dazu musst hier die E-Mail-Adresse eingeben, mit der Du in der Foodsoft angemeldet bist. Du erhälst dann eine E-Mail mit weiteren Instruktionen.
" + submit: Neues Passwort anfordern + title: Passwort vergessen? + new_password: + body: "Bitte neues Passwort für %{user} eingeben.
" + submit: Neues passwort speichern + title: Neues Passwort + mailer: + dateformat: "%d. %b" + feedback: + header: "%{user} schrieb am %{date}:" + subject: Feedback zur Foodsoft + from_via_foodsoft: "%{name} via Foodsoft" + group_order_invoice: + subject: Bestellgruppenrechnung für %{group} bei %{supplier} + text: | + Liebe Bestellgruppe %{group}, + + Die Sammelbestellung bei %{supplier} wurde soeben abgerechnet und für die jeweiligen Bestellgruppen Rechnungen angelegt. + Im Anhang befindet sich daher eure Rechnung. + + Viele Grüße von %{foodcoop} + invite: + subject: Einladung in die Foodcoop + text: | + Hallo! + + %{user} <%{mail}> hat dich in die Gruppe "%{group}" eingeladen. + Um die Einladung anzunehmen und der Foodcoop beizutreten, gehe zu: %{link} + Dieser Link kann nur einmal aufgerufen werden und ist nur bis %{expires} gültig. + + + Grüße sendet die Foodsoft! + negative_balance: + subject: Gruppenkonto im Minus + text: | + Liebe Bestellgruppe %{group}, + + euer Kontostand is durch eine Buchung am %{when} ins Minus gerutscht: %{balance} + Es wurden %{amount} für "%{note}" abgebucht, die Buchung wurde von %{user} erstellt. + Bitte zahlt so bald wie möglich wieder Geld ein, un das Gruppenkonto auszugleichen. + + + Viele Grüße von %{foodcoop} + not_enough_users_assigned: + subject: '"%{task}" braucht noch Leute!' + text: | + Liebe(r) %{user}, + + die Aufgabe '%{task}' deiner Arbeitsgruppe ist am %{when} fällig + und es fehlen noch Mitstreiter_innen! + + Sofern du dich noch nicht für diese Aufgabe eingetragen hast ist des jetzt die Chance: + + %{workgroup_tasks_url} + + Deine Aufgaben: %{user_tasks_url} + order_result: + subject: 'Bestellung beendet: %{name}' + text0: | + Liebe Bestellgruppe %{ordergroup}, + + die Bestellung für "%{order}" wurde am %{when} von %{user} beendet. + text1: | + Sie kann voraussichtlich am %{pickup} abgeholt werden. + text2: | + Für euch wurden die folgenden Artikel bestellt: + text3: |- + o Gesamtpreis: %{sum} + + Bestellung online einsehen: %{order_url} + + + Viele Grüße von %{foodcoop} + order_received: + subject: 'Bestellung entgegengenommen: %{name}' + text0: | + Liebe Bestellgruppe %{ordergroup}, + + die Bestellung für "%{order}" wurde geliefert. + abundant_articles: Zuviel geliefert + scarce_articles: Zuwenig geliefert + article_details: | + o %{name}: + -- Bestellt: %{ordered} x %{unit} + -- Geliefert: %{received} x %{unit} + order_result_supplier: + subject: Neue Bestellung für %{name} + text: | + Guten Tag, + + die Foodcoop %{foodcoop} möchte gerne eine Bestellung abgeben. + + Im Anhang befinden sich ein PDF und eine CSV-Tabelle. + + Mit freundlichen Grüßen + %{user} + %{foodcoop} + reset_password: + subject: Neues Password für %{username} + text: | + Hallo %{user}, + + du (oder jemand anderes) hat auf der Foodsoft-Website ein neues Passwort angefordert. + Um ein neues Passwort einzugeben, gehe zu: %{link} + Dieser Link kann nur einmal aufgerufen werden und läuft am %{expires} ab. + Wenn du das Passwort nicht ändern möchtest oder diese E-Mail nicht ausgelöst hast, brauchst du nichts zu tun. + Dein bisheriges Passwort wurde nicht geändert. + + + Grüße sendet die Foodsoft! :) + upcoming_tasks: + nextweek: 'Aufgaben für die nächtste Woche:' + subject: Aufgaben werden fällig! + text0: | + Liebe(r) %{user}, + + Du bist für "%{task}" eingetragen. Die Aufgabe ist morgen (%{when}) fällig! + text1: | + Deine Aufgaben: %{user_tasks_url} + + + Viele Grüße von %{foodcoop} + welcome: + subject: Willkommen in der Foodcoop + text0: | + Liebe(r) %{user}, + + für dich wurde ein neuer Foodsoft-Zugang erstellt. + text1: | + Um ein neues Passwort einzugeben, gehe zu: %{link} + Dieser Link kann nur einmal aufgerufen werden und läuft am %{expires} ab. + Du kannst jederzeit "Passwort vergessen?" benutzen, um einen neuen Link zu erhalten. + + Viele Grüße von %{foodcoop}. + messages_mailer: + foodsoft_message: + footer: | + Antworten: %{reply_url} + Nachricht online einsehen: %{msg_url} + Nachrichten-Einstellungen: %{profile_url} + footer_group: | + Gesendet an Gruppe: %{group} + model: + delivery: + each_stock_article_must_be_unique: Lieferung darf jeden Lagerartikel höchstens einmal auflisten. + financial_transaction: + foodcoop_name: Foodcoop + financial_transaction_type: + no_delete_last: Es muss mindestens ein Kontotransaktionstyp existieren. + group_order: + stock_ordergroup_name: Lager (%{user}) + invoice: + invalid_mime: hat einen ungültigen MIME-Typ (%{mime}) + membership: + no_admin_delete: Mitgliedschaft kann nicht beendet werden. Du bist die letzte Administratorin + order_article: + error_price: muss angegeben sein und einen aktuellen Preis haben + user: + no_ordergroup: keine Bestellgruppe + group_order_article: + order_closed: Bestellung ist geschlossen und kann nicht geändert werden + navigation: + admin: + config: Einstellungen + finance: Finanzen + home: Übersicht + mail_delivery_status: E-Mail Probleme + ordergroups: Bestellgruppen + title: Administration + users: Benutzer/innen + workgroups: Arbeitsgruppen + articles: + categories: Kategorien + stock: Lager + suppliers: Lieferanten/Artikel + title: Artikel + dashboard: Übersichtsseite + finances: + accounts: Konten verwalten + balancing: Bestellungen abrechnen + bank_accounts: Bankkonten + home: Übersicht + invoices: Rechnungen + title: Finanzen + foodcoop: Foodcoop + members: Mitglieder + ordergroups: Bestellgruppen + orders: + archive: Meine Bestellungen + manage: Bestellverwaltung + ordering: Bestellen! + pickups: Abholtage + title: Bestellungen + tasks: Aufgaben + workgroups: Arbeitsgruppen + number: + percentage: + format: + strip_insignificant_zeros: true + order_articles: + edit: + stock_alert: Preise von Lagerartikeln können nicht geändert werden! + title: Artikel aktualisieren + new: + title: Neuer gelieferter Artikel der Bestellung + ordergroups: + edit: + title: Bestellgruppe bearbeiten + index: + title: Bestellgruppen + model: + error_single_group: "%{user} ist schon in einer anderen Bestellgruppe" + invalid_balance: ist keine gültige Zahl + orders: + articles: + article_count: 'Bestellte Artikel:' + prices: Netto-/Bruttopreis + prices_sum: 'Summe (Netto/Brutto-Preise):' + units_full: Volle Gebinde + members: Mitglieder + deposit: Pfand + units_ordered: Bestellte Einheiten + create: + notice: Die Bestellung wurde erstellt. + edit: + title: 'Bestellung bearbeiten: %{name}' + edit_amount: + field_locked_title: Die Verteilung dieses Artikels auf die einzelnen Bestellgruppen wurde manuell angepasst. Das Eingabefeld wurde gesperrt, um die manuellen Änderungen zu bewahren. Um den Artikel neu zu verteilen, drücke den Entsperrknopf und ändere die gelieferte Menge. + field_unlocked_title: Die Verteilung dieses Artikels auf die einzelnen Bestellgruppen wurde manuell angepasst. Wenn du die gelieferte Menge änderst, werden die vorherigen manuellen Änderungen überschrieben. + edit_amounts: + no_articles_available: Keine Artikel zum hinzufügen verfügbar + set_all_to_zero: Alle auf Null setzen + fax: + amount: Menge + articles: Artikel + delivery_day: Liefertag + heading: Bestellung für %{name} + name: Name + number: Nummer + to_address: Versandaddresse + finish: + notice: Die Bestellung wurde beendet. + form: + ignore_warnings: Warnungen ignorieren + prices: Price (netto/FC) + select_all: Alle auswählen + stockit: Verfügbar + title: Artikel + index: + action_end: Beenden + action_receive: In Empfang nehmen + confirm_delete: Willst Du wirklich die Bestellung löschen? + confirm_end: Willst Du wirklich die Bestellung %{order} beenden? Es gibt kein zurück. + new_order: Neue Bestellung anlegen + no_open_or_finished_orders: Derzeit gibt es keine laufende oder beendete Bestellungen. + orders_finished: Beendet + orders_open: Laufend + orders_settled: Abgerechnet + not_closed: Bestellung noch nicht abgerechnet + title: Bestellungen verwalten + model: + close_direct_message: Die Bestellung wurde abgechlossen, ohne die Mitgliederkonten zu belasten. + error_boxfill_before_ends: muss nach dem Kistenauffülldatum liegen (oder leer bleiben) + error_closed: Bestellung wurde schon abgerechnet + error_nosel: Es muss mindestens ein Artikel ausgewählt sein. + error_starts_before_boxfill: muss nach dem Bestellstart liegen (oder leer bleiben) + error_starts_before_ends: muss nach dem Bestellstart liegen (oder leer bleiben) + notice_close: 'Bestellung: %{name}, bis %{ends}' + stock: Lager + warning_ordered: 'Warnung: Die rot markierten Artikel wurden in der laufenden Bestellung bereits bestellt. Wenn Du sie hier abwählst, werden alle bestehenden Bestellungen dieses Artikels gelöscht.' + warning_ordered_stock: 'Warnung: Die rot markierten Artikel wurden in der laufenden Lagerbestellung bereits bestellt bzw. gekauft. Wenn Du sie hier abwählst, werden alle bestehenden Bestellungen bzw. Käufe dieses Artikels gelöscht und nicht abgerechnet!' + new: + title: Neue Bestellung anlegen + receive: + add_article: Artikel hinzufügen + consider_member_tolerance: Toleranz berücksichtigen + notice: 'Bestellung in Empfang genommen: %{msg}' + notice_none: Keine neuen Artikel für den Empfang ausgewählt. + paragraph: Wenn die Bestellmenge mit der Liefermenge übereinstimmt, können die entsprechenden Felder frei gelassen werden. Es empfiehlt sich aber dennoch alle Felder auszufüllen, da daurch einfach nachvollziebar ist ob alle Mengen kontrolliert wurden. + rest_to_stock: Rest ins Lager + submit: Bestellung in Empfang nehmen + surplus_options: 'Verteilungsoptionen:' + title: '»%{order}« in Empfang nehmen' + send_to_supplier: + notice: Die Bestellung wurde an die Lieferantin geschickt. + show: + action_end: Beenden! + amounts: 'Netto/Bruttosumme:' + articles: Artikelübersicht + articles_ordered: 'Bestellte Artikel:' + comments: + title: Kommentare + comments_link: Kommentare + confirm_delete: Willst Du wirklich die Bestellung löschen? + confirm_end: |- + Willst Du wirklich die Bestellung %{order} beenden? + Es gibt kein zurück. + confirm_send_to_supplier: Die Bestellung wurde bereit am %{when} zur Lieferantin geschickt. Willst du sie wirklich erneut schicken? + create_invoice: Rechnung anlegen + description1_order: "%{state} Bestellung von %{supplier} angelegt von %{who}," + description1_period: + pickup: und kann am %{pickup} abgeholt werden + starts: läuft von %{starts} + starts_ends: läuft von %{starts} bis %{ends} + description2: "%{ordergroups} haben %{article_count} Artikel mit einem Gesamtwert von %{net_sum} / %{gross_sum} (netto / brutto + fc + Pfand) bestellt." + description3: " Zuzüglich Pfand %{net_deposit} / %{deposit} (netto / brutto)." + group_orders: 'Gruppenbestellungen:' + search_placeholder: + articles: Suche nach Artikeln ... + default: Suche nach Artikeln ... + groups: Suche nach Bestellgruppen ... + search_reset: Suche zurücksetzen + send_to_supplier: An Lieferantin schicken + show_invoice: Rechnung anzeigen + sort_article: Sortiert nach Artikeln + sort_group: Sortiert nach Gruppen + stock_order: Lagerbestellung + title: 'Bestellung: %{name}' + warn_not_closed: Achtung, Bestellung wurde noch nicht abgerechnet. + state: + closed: abgerechnet + finished: beendet + open: laufend + received: in Empfang genommen + update: + notice: Die Bestellung wurde aktualisiert. + update_order_amounts: + msg1: "%{count} Artikel (%{units} Einheiten) aktualisiert" + msg2: "%{count} (%{units}) Toleranzmenge" + msg4: "%{count} (%{units}) übrig" + pickups: + document: + empty_selection: Es muss zumindest eine Bestellung ausgewählt sein. + filename: Abholungen für %{date} + invalid_document: Ungültiger Dokumententyp + title: Abholungen für %{date} + index: + article_pdf: Artikel PDF + group_pdf: Gruppen PDF + matrix_pdf: Matrix PDF + title: Abholtage + sessions: + logged_in: Angemeldet! + logged_out: Abgemeldet! + login_invalid_email: Ungültige E-Mail Adresse oder Passwort + login_invalid_nick: Benutzername oder Passwort ungültig + new: + forgot_password: Passwort vergessen? + login: Anmelden + nojs: Achtung, Cookies und Javascript müssen aktiviert sein! %{link} bitte abschalten. + noscript: NoScript + title: Foodsoft anmelden + shared: + articles: + ordered: Bestellt + ordered_desc: Anzahl der Artikel die durch das Mitglied bestellt wurden (Menge + Toleranz) + received: Bekommen + received_desc: Anzahl der Artikel die ein Mitglied erhält + articles_by: + price: Gesamtpreis + price_sum: Summe + group: + access: Zugriff auf + activated: aktiviert + apple_limit: Äpfel-Bestellbeschränkung + break: von %{start} bis %{end} + deactivated: deaktiviert + group_form_fields: + search: Suche ... + search_user: Nach Nutzerin suchen + user_not_found: Keine Nutzerin gefunden + open_orders: + no_open_orders: Derzeit gibt es keine laufenden Bestellungen + not_enough_apples: Achtung, Deine Bestellgruppe hat zu wenig Äpfel um Bestellen zu können! + title: Laufende Bestellungen + total_sum: Gesamtsumme + who_ordered: Wer hat bestellt? + order_download_button: + article_pdf: Artikel PDF + download_file: Datei herunterladen + fax_csv: Fax CSV + fax_pdf: Fax PDF + fax_txt: Fax Text + group_pdf: Gruppen PDF + matrix_pdf: Matrix PDF + title: Herunterladen + task_list: + accept_task: Aufgabe übernehmen + done: Erledigt + done_q: Erledigt? + mark_done: Aufgabe als erledigt markieren + reject_task: Aufgabe ablehnen + who: Wer machts? + who_hint: "(Wie viele werden noch benötigt?)" + user_form_fields: + contact_address_hint: Die Adresse deiner Bestellgruppe. Wenn du sie aktualisierst, wird sie auch bei den anderen Mitgliedern deiner Bestellgruppe aktualisiert. + messagegroups: Nachrichtengruppen beitreten oder verlassen + workgroup_members: + title: Mitglieder der Gruppen + simple_form: + error_notification: + default_message: Fehler wurden gefunden. Bitte das Formular überprüfen. + hints: + article: + unit: z.B. KG oder 1L oder 500g + article_category: + description: Kommagetrennte Liste von Kategorienamen die beim Import/Datenabgleich erkannt wurden + order_article: + units_to_order: Wenn Du die Gesamtanzahl gelieferter Gebinde änderst, musst Du auch die individuelle Anzahl der einzelnen Bestellgruppen anpassen, indem Du auf den Artikelnamen klickst. Sie werden nicht automatisch neuberechnet und andernfalls werden den Bestellgruppen Artikel in Rechnung gestellt, die nicht geliefert wurden! + update_global_price: Ändert auch den Preis für zukünftige Bestellungen + stock_article: + copy: + name: Bitte ändern + edit_stock_article: + price: "Hier werden die Lieferantinnen der externen Datenbank angezeigt.
Ihr könnt externe Lieferantinnen importieren, indem ihr sie einfach abonniert. (siehe unten)
Damit wird eine neue Lieferantin angelegt und mit der externen Datenbank verknüpft.
" + subscribe: abonnieren + subscribe_again: erneut abonnieren + supplier: Lieferantin + title: Externe Listen + show: + last_deliveries: Letzte Lieferungen + last_orders: Letzte Bestellungen + new_delivery: Neue Lieferung anlegen + show_deliveries: Zeige alle Lieferungen + update: + notice: Lieferant wurde aktualisiert + tasks: + accept: + notice: Du hast die Aufgabe übernommen + archive: + title: Aufgabenarchiv + create: + notice: Aufgabe wurde erstellt + destroy: + notice: Aufgabe wurde gelöscht + edit: + submit_periodic: Wiederkehrende Aufgabe speichern + title: Aufgabe bearbeiten + title_periodic: Wiederkehrende Aufgabe ändern + warning_periodic: "Warnung: Diese Aufgabe ist Teil einer Gruppe von wöchentlichen Aufgaben. Beim Speichern wird sie aus der Gruppe ausgeschlossen und in eine gewöhnliche Aufgabe umgewandelt." + error_not_found: Keine Arbeitsgruppe gefunden + form: + search: + hint: Nach Nutzerin suchen + noresult: Keine Nutzerin gefunden + placeholder: Suche ... + submit: + periodic: Wiederkehrende Aufgabe speichern + index: + show_group_tasks: Gruppenaufgaben anzeigen + title: Aufgaben + title_non_group: Aufgaben für alle! + nav: + all_tasks: Alle Aufgaben + archive: Erledigte Aufgaben (Archiv) + group_tasks: Gruppenaufgaben + my_tasks: Meine Aufgaben + new_task: Neue Aufgabe erstellen + pages: Seiten + new: + submit_periodic: Wiederkehrende Aufgabe anlegen + title: Neue Aufgabe erstellen + repeated: Aufgabe wird wiederholt + set_done: + notice: Aufgabenstatus wurde aktualisiert + show: + accept_task: Aufgabe übernehmen + confirm_delete_group: Diese und alle folgenden wöchentlichen Aufgaben wirklich löschen? + confirm_delete_single: Die Aufgabe wirklich löschen? + confirm_delete_single_from_group: Bist Du sicher, dass Du diese Aufgabe löschen möchtest (und in Bezug stehende wiederkehrende Aufgabe behalten möchtest)? + delete_group: Aufgabe und folgende löschen + edit_group: Wiederkehrende ändern + hours: "%{count}h" + mark_done: Als erledigt markieren + reject_task: Aufgabe ablehnen + title: Aufgabe anzeigen + update: + notice: Aufgabe wurde aktualisiert + notice_converted: Aufgabe wurde aktualisiert und in eine gewöhnliche Aufgabe umgewandelt + user: + more: Nichts zu tun? %{tasks_link} gibt es bestimmt Arbeit + tasks_link: Hier + title: Meine Aufgaben + title_accepted: Anstehende Aufgaben + title_open: Offene Aufgaben + workgroup: + title: Aufgaben für %{workgroup} + title_all: Alle Aufgaben der Gruppe + ui: + actions: Aktionen + back: Zurück + cancel: Abbrechen + close: Schließen + confirm_delete: Willst du %{name} wirklich löschen? + confirm_restore: Willst du %{name} wirklich wiederherstellen? + copy: Kopieren + delete: Löschen + download: Herunterladen + edit: Bearbeiten + marks: + close: "×" + success: + move: Verschieben + or_cancel: oder abbrechen + please_wait: Bitte warten... + restore: Wiederherstellen + save: Speichern + search_placeholder: Suchen ... + show: Anzeigen + views: + pagination: + first: "«" + last: "»" + next: "›" + previous: "‹" + truncate: "..." + workgroups: + edit: + title: Arbeitsgruppe bearbeiten + error_last_admin_group: Die letzte Gruppe mit Admin-Rechten darf nicht gelöscht werden + error_last_admin_role: Der letzten Gruppe mit Admin-Rechten darf die Admin-Rolle nicht entzogen werden + index: + title: Arbeitsgruppen + update: + notice: Arbeitsgruppe wurde aktualisiert + time: + formats: + foodsoft_datetime: "%d.%m.%Y %H:%M" + file: "%Y-%d-%B" \ No newline at end of file diff --git a/plugins/automatic_invoices/config/locales/en.yml b/plugins/automatic_invoices/config/locales/en.yml new file mode 100644 index 00000000..b259b68b --- /dev/null +++ b/plugins/automatic_invoices/config/locales/en.yml @@ -0,0 +1,1992 @@ +en: + activerecord: + attributes: + article: + article_category: Category + availability: Is article available? + availability_short: avail. + deposit: Deposit + fc_price: FoodCoop price + fc_price_desc: Price including taxes, deposit and Foodcoop-charge. + fc_price_short: FC price + fc_share: FoodCoop margin + fc_share_short: FC margin + gross_price: Gross price + manufacturer: Manufacturer + name: Name + note: Note + order_number: Order number + order_number_short: Nr. + origin: Origin + price: Price (net) + supplier: Supplier + tax: VAT + unit: Unit + unit_quantity: Unit quantity + unit_quantity_short: U.Q. + units: Units + article_category: + description: Import names + name: Name + article_price: + deposit: Deposit + price: Price (net) + tax: VAT + unit_quantity: Unit quantity + bank_account: + balance: Balance + bank_gateway: Bank gateway + description: Description + iban: IBAN + name: Name + bank_gateway: + authorization: Authorization-Header + name: Name + unattended_user: Unattended user + url: URL + bank_transaction: + amount: Amount + date: Date + external_id: External ID + financial_link: Financial link + iban: IBAN + reference: Referenz + text: Description + delivery: + date: Delivery date + note: Note + supplier: Supplier + document: + created_at: Created at + created_by: Created by + data: Data + mime: MIME type + name: Name + financial_transaction: + amount: Amount + created_on: Date + financial_transaction_class: Financial transaction class + financial_transaction_type: Financial transaction type + note: Note + ordergroup: Ordergroup + user: Entered by + financial_transaction_class: + ignore_for_account_balance: Ignore for account balance + name: Name + financial_transaction_type: + bank_account: Bank Account + name: Name + financial_transaction_class: Financial transaction class + name_short: Short Name + group_order: + ordergroup: Ordergroup + price: Order sum + updated_by: Last ordered by + group_order_article: + ordered: Ordered + quantity: Amount + received: Received + result: Amount + tolerance: Tolerance + total_price: Sum + unit_price: Price/Unit + group_order_invoice: + name: Group order invoice + links: + delete: delete invoice + download: download invoice + invoice_date: date of group order invoice + generate: generate invoice + generate_with_date: set & generate + download_all_zip: download all invoices as zip + + payment_method: Credit + tax_number_not_set: Tax number not set in configs + invoice: + amount: Amount + attachment: Attachment + created_at: Created at + created_by: Created by + date: Billing date + delete_attachment: Delete attachment + deliveries: Stock delivery + deposit: Deposit charged + deposit_credit: Deposit returned + financial_link: Financial link + net_amount: Amount adjusted for refund + note: Note + number: Number + orders: Order + paid_on: Paid on + supplier: Supplier + mail_delivery_status: + created_at: Time + email: Email + message: Message + order: + boxfill: Fill boxes after + closed_by: Settled by + created_by: Created by + end_action: End action + end_actions: + auto_close: Close the order + auto_close_and_send: Close the order and send it to the supplier + auto_close_and_send_min_quantity: Close the order and send it to the supplier if the minimum quantity has been reached + no_end_action: No automatic action + ends: Ends at + name: Supplier + note: Note + pickup: Pickup + starts: Starts at + status: Status + supplier: Supplier + transport: Transport costs + transport_distribution: Transport costs distribution + transport_distributions: + articles: Distribute the costs among the number of received articles + ordergroup: Every ordergroup pays the same amount + price: Distribute the costs among the order sum + skip: Do not distribute the costs + updated_by: Last edited by + order_article: + article: Article + missing_units: Missing units + missing_units_short: Missing + quantity: Desired amount + quantity_short: Desired + units_received: Received units + units_received_short: Received + units_to_order: Ordered units + units_to_order_short: Ordered + update_global_price: Globally update current price + order_comment: + text: Add comment to this order ... + ordergroup: + account_balance: Account balance + available_funds: Available credit + break: "(Last) break" + break_until: until + contact: Contact + contact_address: Address + contact_person: Contact person + contact_phone: Phone + customer_number: Customer number + description: Description + ignore_apple_restriction: Ignore order stop by apple points restriction + last_order: Last order + last_user_activity: Last activity + name: Name + user_tokens: Members + stock_article: + available: Available + price: Price + quantity: In stock + quantity_available: Available quantity + quantity_available_short: Avail. + quantity_ordered: Ordered + stock_taking: + date: Date + note: Note + supplier: + address: Address + contact_person: Contact person + customer_number: Customer number + customer_number_short: Cust.nr. + delivery_days: Delivery days + email: Email + fax: Fax + iban: IBAN + is_subscribed: subscribed? + min_order_quantity: Minimum order quantity + min_order_quantity_short: Min. quantity + name: Name + note: Note + order_howto: How to order + phone: Phone + phone2: Phone 2 + shared_sync_method: How to synchronize + url: Homepage + supplier_category: + name: Name + description: Description + financial_transaction_class: Financial transaction class + bank_account: Bank account + task: + created_by: Created by + created_on: Created at + description: Description + done: Done? + due_date: Due date + duration: Duration + name: Activity + required_users: People required + user_list: Responsible users + workgroup: Workgroup + user: + email: Email + first_name: First name + iban: IBAN + last_activity: Last activity + last_login: Last login + last_name: Last name + name: Name + nick: Username + ordergroup: Ordergroup + password: Password + password_confirmation: Repeat password + phone: Telephone + workgroup: + one: Workgroup + other: Workgroups + workgroup: + description: Description + name: Name + role_admin: Administration + role_article_meta: Article database + role_finance: Finances + role_invoices: Invoices + role_orders: Order management + role_pickups: Pickup days + role_suppliers: Suppliers + user_tokens: Members + errors: + has_many_left: is still associated with a %{collection}! + models: + article: + attributes: + name: + taken: name is already taken + taken_with_unit: name and unit are already taken + supplier: + attributes: + shared_sync_method: + included: is not a valid option for this supplier + task: + attributes: + done: + exclusion: finished tasks may not be repeated + models: + article: Article + article_category: Category + bank_account: Bank account + bank_gateway: Bank gateway + bank_transaction: Bank transaction + delivery: Delivery + financial_transaction: Financial transaction + financial_transaction_class: Financial transaction class + financial_transaction_type: Financial transaction type + invoice: Invoice + order: Order + order_article: Order article + order_comment: Order comment + ordergroup: + one: Ordergroup + other: Ordergroups + stock_article: Stock article + stock_taking: Stock taking + supplier: Supplier + supplier_category: Supplier category + task: Task + user: User + workgroup: Workgroup + admin: + access_to: access to + base: + index: + all_ordergroups: All ordergroups + all_users: All users + all_workgroups: All workgroups + created_at: created at + first_paragraph: Here you can administer Foodsoft groups and users. + groupname: group name + members: members + name: name + new_ordergroup: New ordergroup + new_user: New user + new_workgroup: New workgroup + newest_groups: newest groups + newest_users: newest users + title: Administration + type: type + username: username + bank_accounts: + form: + title_edit: Edit bank account + title_new: Add new bank account + bank_gateways: + form: + title_edit: Edit bank gateway + title_new: Add new bank gateway + configs: + list: + key: Key + title: Configuration list + value: Value + show: + submit: Save + title: Configuration + tab_layout: + pdf_title: PDF documents + tab_messages: + emails_title: Sending email + tab_payment: + schedule_title: Ordering schedule + group_order_invoices: Group order invoices + tab_security: + default_roles_title: Access to + default_roles_paragraph: By default every member of the foodcoop has access to the following areas. + tab_tasks: + periodic_title: Periodic tasks + tabs: + title: Configuration + update: + notice: Configuration saved. + confirm: Are you sure? + finances: + index: + bank_accounts: Bank accounts + first_paragraph: Here you can manage the financial transaction classes and the corresponding financial transaction types. Every financial transaction has a type, which you have to select at every transaction, if you created more than one type. The financial transaction classes can be use to group the financial transaction types and will be shown as additional columns in the account overview, if there have been created more than one. + new_bank_account: Add new bank account + new_financial_transaction_class: Add new financial transaction class + new_bank_gateway: Add new bank gateway + title: Finances + transaction_types: Financial transaction types + supplier_categories: Supplier categories + new_supplier_category: New supplier category + transaction_types: + name: Name + new_financial_transaction_type: Add new financial transaction type + financial_transaction_classes: + form: + title_edit: Edit financial transaction class + title_new: Add new financial transaction class + financial_transaction_types: + form: + name_short_desc: The short name is mandatory for financial transaction types which should be automatically assignable in bank transactions. If there are multiple bank accounts, the preferred target account for bank transfers can be selected. + title_edit: Edit financial transaction type + title_new: Add new financial transaction type + mail_delivery_status: + destroy_all: + notice: All email problems were deleted + index: + destroy_all: Delete all email problems + title: Email problems + ordergroups: + destroy: + error: 'Ordergroup could not be marked as deleted: %{error}' + notice: Ordergroup was marked as deleted + edit: + title: Edit ordergroup + form: + first_paragraph: You can invite new members %{url}. + here: here + index: + first_paragraph: Here you can add %{url}, and edit or delete groups. + new_ordergroup: Add new ordergroup + new_ordergroups: new ordergroups + second_paragraph: 'Consider the difference between group and ordergroup: An ordergroup has an account and can order food. In a %{url} (for example ''sorting group''), members coordinate with each other via tasks and messages. Users can only be in one ordergroup, but can be in multiple workgroups.' + title: Ordergroups + workgroup: workgroup + new: + title: Create ordergroup + show: + confirm: Are you sure? + edit: Edit group/members + title: Ordergroup %{name} + search_placeholder: name ... + users: + controller: + sudo_done: You are now logged in as %{user}. Be careful, and do not forget to log out when done! + destroy: + error: 'User could not be deleted: %{error}' + notice: User was deleted + edit: + title: Edit user + form: + create_ordergroup: Create ordergroup with the same name and add user. + send_welcome_mail: Send a welcome mail to the user. + index: + first_paragraph: Here you can %{url}, edit and delete users. + new_user: Create new user + new_users: create new + show_deleted: Show deleted users + title: User admin + new: + title: Create new user + restore: + error: 'User could not be restored: %{error}' + notice: User was restored + show: + confirm_sudo: If you continue, you will take on the identity of %{user}. Do not forget to log out when you're done! + groupabos: Group subscriptions + member_since: Member since %{time} + person: Person + preference: Preferences + show_email_problems: Show email problems + sudo: Take on identity + users: + show_email_problems: Show email problems + workgroups: + destroy: + error: 'Workgroup could not be deleted: %{error}' + notice: Workgroup was deleted + edit: + title: Edit workgroup + form: + first_paragraph: You can invite new members %{url}. + here: here + index: + first_paragraph: Here you can create %{url}, edit and delete them. + new_workgroup: Create new workgroup + new_workgroups: new workgroups + ordergroup: ordergroup + second_paragraph: 'Consider the difference between a workgroup and an ordergroup: an %{url} has an account and can order food. In a workgroup (for example ''sorting group''), members coordinate with each other via tasks and messages. Users can only be in one ordergroup, but can be in multiple workgroups.' + title: Workgroups + new: + title: Create workgroup + show: + confirm: Are you sure? + edit: Edit group/members + title: Workgroup %{name} + workgroups: + members: members + name: name + supplier_categories: + form: + title_new: Add supplier category + title_edit: Edit supplier category + application: + controller: + error_authn: Authentication required! + error_denied: You are not allowed to view the requested page. If you think you should, ask an administrator to give you appropriate permissions. If you have access to multiple user accounts, you might want to %{sign_in}. + error_denied_sign_in: sign in as another user + error_feature_disabled: This feature is currently disabled. + error_members_only: This action is only available to members of the group! + error_minimum_balance: Sorry, your account balance is below the minimum of %{min}. + error_token: Access denied (invalid token)! + article_categories: + create: + notice: Category was stored + destroy: + error: 'Category could not be deleted: %{message}' + edit: + title: Edit category + index: + new: Add new category + title: Article categories + new: + title: Add new category + update: + notice: Category was updated + articles: + article: + last_update: 'last updated: %{last_update} | gross: %{gross_price}' + articles: + confirm_delete: Do you really want to delete all selected articles? + option_available: Make articles available + option_delete: Delete article + option_not_available: Make articles unavailable + option_select: Select action ... + price_netto: Price + unit_quantity_desc: Unit quantity + unit_quantity_short: U.Q. + controller: + create_from_upload: + notice: "%{count} new articles were saved." + error_invalid: There are errors in articles + error_nosel: No articles selected + error_parse: "%{msg} ... in line %{line}" + error_update: 'An error occured when updating article ''%{article}'': %{msg}' + parse_upload: + no_file: Please select a file to upload. + notice: "%{count} articles were succesfully analysed." + sync: + notice: Catalog is up to date + shared_alert: "%{supplier} is not linked to an external database" + update_all: + notice: All articles and prices were updated. + update_sel: + notice_avail: All selected articles were set to be available. + notice_destroy: All selected articles were deleted. + notice_noaction: No action specified! + notice_unavail: All selected articles were set to be unavailable. + update_sync: + notice: All articles and prices were updated. + destroy_active_article: + drop: delete + note: "%{article} is used in current orders and can not be deleted Please first ... the article from orders %{drop_link}." + edit_all: + note: 'Mandatory fields are: name, unit, (net) price and order number.' + submit: Update all articles + title: Edit all articles from %{supplier} + warning: 'Warning: all articles will be updated!' + form: + title_edit: Edit article + title_new: Add new article + import_search_results: + action_import: import + already_imported: imported + not_found: No articles found + index: + change_supplier: Change supplier ... + download: Download articles + edit_all: Edit all + ext_db: + import: Import article + sync: Synchronise + import: + category: Directly import into category + placeholder: Search by name ... + restrict_region: Restrict to region only + title: Import article + new: New article + new_order: Create new order + search_placeholder: Name ... + title: Articles from %{supplier} (%{count}) + upload: Upload articles + model: + error_in_use: "%{article} can not be deleted because the article is part of a current order!" + error_nosel: You have selected no articles + parse_upload: + body: "Please verify the articles.
Warning, at the moment there is no check for duplicate articles.
" + submit: Process upload + title: Upload articles + sync: + outlist: + alert_used: Warning, %{article} is used in an open order. Please remove it from the order first. + body: 'The following articles were removed from the list and will be deleted:' + body_ignored: + one: One article without order number was skipped. + other: "%{count} articles without order number were skipped." + body_skip: No articles to delete. + title: Remove from list ... + price_short: Price + submit: Synchronize all + title: Synchronize articles with external database + unit_quantity_short: Unit quantity + update: + body: 'Every article is shown twice: old values are gray, while the text fields contain updated values. Differences with the old articles are marked yellow.' + title: Update ... + update_msg: + one: One article needs to be updated. + other: "%{count} articles need to be updated." + upnew: + body_count: + one: There is one new article to add. + other: There are %{count} articles to add. + title: Add new ... + upload: + fields: + reserved: "(Reserved)" + status: Status (x=skip) + file_label: Please choose a compatible file + options: + convert_units: Keep current units, recompute unit quantity and price (like synchronize). + outlist_absent: Delete articles not in uploaded file. + sample: + juices: Juices + nuts: Nuts + organic: Organic + supplier_1: Nuttyfarm + supplier_2: Brownfields + supplier_3: Greenfields + tomato_juice: Tomato juice + walnuts: Walnuts + submit: Upload file + text_1: 'Here you can upload a spreadsheet to update the articles of %{supplier}. Excel (xls, xlsx) and OpenOffice (ods) spreadsheets are accepted, as well as comma-separated files (csv, columns separated by ";" with utf-8 encoding). Only the first sheet will be imported, and columns must be in the following order:' + text_2: The rows shown here are examples. When there is an "x" in the first column, the article is outlisted and will be removed. This allows you to edit the spreadsheet and quickly remove many articles at once, for example when articles become unavailable with the supplier. The category will be matched to your Foodsoft category list (both by category name and import names). + title: Upload articles of %{supplier} + bank_account_connector: + confirm: Please confirum the code %{code}. + fields: + email: E-Mail + pin: PIN + password: Password + tan: TAN + username: Username + config: + hints: + applepear_url: Website where the apple and pear system for tasks is explained. + charge_members_manually: When you keep track of who received what elsewhere (e.g. on paper), and you don't want to enter this into Foodsoft, select this. You'll need to charge member accounts manually (using "Add new transactions"). You still need to settle orders in the balancing screen, but this will not charge any member accounts. + contact: + email: General contact email address, shown on website as well as some forms. + street: Address, typically this will be your delivery and pick-up location. + currency_space: Whether to add whitespace after the currency symbol. + currency_unit: Currency symbol for displaying prices. + custom_css: To modify the layout of this site, you can enter style modifications using the cascading stylesheets (CSS) language. Leave blank for the default style. + email_from: Emails will appear to be from this email address. Leave empty to use the foodcoop's contact address. + email_replyto: Set this when you want to receive replies from emails sent by Foodsoft on a different address than the above. + email_sender: Emails will appear to be sent from this email address. To avoid emails sent being classified as spam, the webserver may need to be registered in the SPF record of the email address's domain. + use_automatic_invoices: A listing of the invoice items is made without explicit display of VAT and the invoice receives the necessary addition regarding the small business regulation §19 (applies to Germany) + payment_method: Payment type is declared on the order group invoice + vat_exempt: A listing of the invoice items is made without explicit display of VAT and the invoice contains the necessary addition regarding the German Kleinunternehmerregelung §19 UStG (attention! FoodCoop marge not included in nvoice). + help_url: Documentation website. + homepage: Website of your foodcoop. + ignore_browser_locale: Ignore the language of user's computer when the user has not chosen a language yet. + minimum_balance: Members can only order when their account balance is above or equal to this amount. + name: The name of your foodcoop. + order_schedule: + boxfill: + recurr: Schedule for when the box-fill phase starts by default. + time: Default time when the box-fill phase of the ordering starts. + ends: + recurr: Schedule for default order closing date. + time: Default time when orders are closed. + initial: Schedule starts at this date. + page_footer: Shown on each page at the bottom. Enter "blank" to disable the footer completely. + pdf_add_page_breaks: + order_by_articles: Put each article on a separate page. + order_by_groups: Put each ordergroup on a separate page. + pdf_font_size: Base font size for PDF documents (12 is standard). + pdf_page_size: Page size for PDF documents, typically "A4" or "letter". + price_markup: Percentage that is added to the gross price for foodcoop members. + stop_ordering_under: Members can only order when they have at least this many apple points. + tasks_period_days: Number of days between two periodic tasks (default 7, which is a week). + tasks_upfront_days: For how many days in advance you would like to schedule periodic tasks. + tax_default: Default VAT percentage for new articles. + tolerance_is_costly: Order as much of the member tolerance as possible (compared to only as much needed to fill the last box). Enabling this also includes the tolerance in the total price of the open member order. + distribution_strategy: How articles should be distributed after an order has been received. + use_apple_points: When the apple point system is enabled, members are required to do some tasks to be able to keep ordering. + use_automatic_invoices: When an order is settled, invoices for the individual order groups are automatically sent by mail + payment_method: Payment Method for group order invoices + use_boxfill: When enabled, near end of an order, members are only able to change their order when increases the total amount ordered. This helps to fill any remaining boxes. You still need to set a box-fill date for the orders. + use_iban: When enabled, supplier and user provide an additonal field for storing the international bank account number. + use_nick: Show and use nicknames instead of real names. When enabling this, please check that each user has a nickname. + use_self_service: When enabled, members are able to use selected balancing functions on their own. + webstats_tracking_code: Tracking code for web analytics (like Piwik or Google analytics). Leave empty for no tracking. + keys: + applepear_url: Apple system help URL + charge_members_manually: Charge members manually + contact: + city: City + country: Country + email: Email + phone: Phone + street: Street + zip_code: Postcode + tax_number: Tax number + currency_space: add space + currency_unit: Currency + custom_css: Custom CSS + default_locale: Default language + default_role_article_meta: Articles + default_role_finance: Finance + default_role_invoices: Invoices + default_role_orders: Orders + default_role_pickups: Pickup days + default_role_suppliers: Suppliers + disable_invite: Disable invites + disable_members_overview: Disable members list + email_from: From address + email_replyto: Reply-to address + email_sender: Sender address + help_url: Documentation URL + homepage: Homepage + ignore_browser_locale: Ignore browser language + minimum_balance: Minimum balance + name: Name + order_schedule: + boxfill: + recurr: Box fill after + time: time + ends: + recurr: Order ends + time: time + initial: Schedule start + page_footer: Page footer + pdf_add_page_breaks: Page breaks + pdf_font_size: Font size + pdf_page_size: Page size + price_markup: Foodcoop margin + stop_ordering_under: Minimum apple points + tasks_period_days: Period + tasks_upfront_days: Create upfront + tax_default: Default VAT + time_zone: Time zone + tolerance_is_costly: Tolerance is costly + distribution_strategy: Distribution strategy + distribution_strategy_options: + first_order_first_serve: First distribute to those who ordered first + no_automatic_distribution: No automatic distribution + use_apple_points: Apple points + group_order_invoices: + use_automatic_invoices: Send automatically via mail after oder settlement + payment_method: Payment method + separate_deposits: Separate deposits on invoice + vat_exempt: This foodcoopis VAT exempt + use_boxfill: Box-fill phase + use_iban: Use IBAN + use_nick: Use nicknames + use_self_service: Use self service + webstats_tracking_code: Tracking code + tabs: + applications: Apps + foodcoop: Foodcoop + language: Language + layout: Layout + list: List + messages: Messages + others: Other + payment: Finances + security: Security + tasks: Tasks + deliveries: + add_stock_change: + how_many_units: 'How many units (%{unit}) to deliver? Stock article name: %{name}.' + create: + notice: Delivery was created. Please don’t forget to add an invoice! + destroy: + notice: Delivery was deleted. + edit: + title: Edit delivery + form: + confirm_foreign_supplier_reedit: The stock article %{name} was successfully saved. However, it belongs to a different supplier than this delivery. Would you like to edit the stock article again? + create_from_blank: Create new article + create_stock_article: Create stock article + title_fill_quantities: 2. Set delivery quantities + title_finish_delivery: 3. Finish delivery + title_select_stock_articles: 1. Select stock articles + index: + confirm_delete: Are you sure? + new_delivery: 'Create new delivery for %{supplier} ' + title: "%{supplier}/deliveries" + invoice_amount: Invoice amount + invoice_net_amount: Invoice net amount + new: + title: New delivery from %{supplier} + show: + sum: Sum + sum_diff: Gross - adjusted invoice amount + sum_gross: Gross sum + sum_net: Net sum + title: Show delivery + title_articles: Articles + stock_article_for_adding: + action_add_to_delivery: Add to delivery + action_edit: Edit + action_other_price: Copy + stock_change_fields: + remove_article: Remove article from delivery + suppliers_overview: Supplier overview + update: + notice: Delivery was updated. + documents: + group_order_invoice_pdf: + ordergroup: + contact_phone: 'Phone: %{contact_phone}' + contact_address: 'Adress : %{contact_address}' + customer_number: 'Customer number: %{customer_number}' + name: 'Ordergroup: %{ordergroup}' + filename: Invoice%{number} + invoicee: Invoicee + invoicer: Invoicer + invoice_date: 'Invoice date: %{invoice_date}' + invoice_number: 'Invoice number: %{invoice_number}' + markup_included: incl Foodcoop Marge on gross price %{marge}% + payment_method: 'Payment_method: %{payment_method}' + small_business_regulation: As a small entrepreneur in the sense of §19 para. 1 of the Umsatzsteuergesetz (UStG), no value added tax is charged. + sum_to_pay: Total sum + sum_to_pay_net: Total sum (net) + sum_to_pay_gross: Total sum (gross) + table_headline: 'The following items will be charged for the order:' + tax_excluded: excl. MwSt. + tax_included: incl. VAT %{tax}% + tax_number: 'Tax number: %{number}' + title: Invoice for order at %{supplier} + vat_exempt_rows: + - Name + - Quantity + - Unit price + - Total price + no_price_markup_rows: + - Name + - Quantity + - Unit price (net) + - Total price (net) + - VAT + - Total price (gross) + price_markup_rows: + - Name + - Quantity + - Unit price (net) + - Total price (net) + - VAT + - Total price (gross) incl. foodcoop margin + order_by_articles: + filename: Order %{name}-%{date} - by articles + title: 'Order sorted by articles: %{name}, closed at %{date}' + order_by_groups: + filename: Order %{name}-%{date} - by group + sum: Sum + title: 'Order sorted by group: %{name}, closed at %{date}' + order_fax: + filename: Order %{name}-%{date} - Fax + rows: + - Order Number + - Amount + - Name + - Unit quantity + - Unit + - Price/Unit + - Subtotal + total: Total + order_matrix: + filename: Order %{name}-%{date} - sorting matrix + heading: Article overview (%{count}) + title: 'Order sorting matrix: %{name}, closed at %{date}' + errors: + check_tax_number: Please check whether the foodcoop's tax number is set correctly. + general: A problem has occured. + general_again: A problem has occured. Please try again. + general_msg: 'A problem has occured: %{msg}' + internal_server_error: + text1: An unexpected error has occured. Sorry! + text2: We've been notified. If this remains a problem, please tell us so. + title: Internal server error + not_found: + text: This page does not appear to exist, sorry! + title: Page not found + feedback: + create: + notice: Your feedback was sent successfully. Thanks a lot! + new: + first_paragraph: Found a bug? Suggestions? Ideas? Reviews? We are happy to hear any feedback. + second_paragraph: Please be aware that the Foodsoft Team is only responsible for the maintenance of the software. For questions regarding the organisation of your Foodcoop, please contact the appropriate contact person. + send: Send + title: Give feedback + finance: + balancing: + close: + alert: 'An error occured while accounting: %{message}' + notice: Order was settled succesfully, the balance of the account was updated. + settings_not_set: No emails with order group invoices sent. Please check the settings. Tax number set? + close_all_direct_with_invoice: + notice: '%{count} orders have been settled.' + close_direct: + alert: 'Order can not be settled: %{message}' + notice: Order was settled. + confirm: + clear: Settle + first_paragraph: 'When the order is settled, all group accounts will be updated.Here you can write a message to the members of your Foodcoop. If you'd like others to contact you, please enable it in your %{profile_link}.
" + ph_name: Name ... + ph_ordergroup: Ordergroup ... + profile_link: options + title: Users + workgroups: + edit: + invite_link: here + invite_new: You can invite new members %{invite_link}. + title: Edit group + index: + body: "Editing a group is only available to members of the group.
If you want to join a group, please send the members a message.
Here you can invite someone who isn't part of the foodcoop to join your ordergroup %{group}. After the invitation is accepted, the person will be able to add (and remove) articles to your order.
This is a great way to introduce someone to the foodcoop, or to order with multiple people in the same household.
" + title: Invite person + new: + action: Send invite + body: "Here you can add a person to the group %{group}, who is not yet a member of the foodcoop.
" + success: User was invited successfully. + js: + ordering: + confirm_change: Modifications to this order will be lost when you change the order. Do you want to lose the changes you made and continue? + trix_editor: + file_size_alert: The file is to large! The supported file size is 512Mb! + layouts: + email: + footer_1_separator: "--" + footer_2_foodsoft: 'Foodsoft: %{url}' + footer_3_homepage: 'Foodcoop: %{url}' + footer_4_help: 'Help: %{url}' + help: 'Help' + foodsoft: Foodsoft + footer: + revision: revision %{revision} + header: + feedback: + desc: Found a bug? Suggestions? Ideas? Review? + title: Feedback + help: Help + logout: Logout + ordergroup: My ordergroup + profile: Edit profile + reference_calculator: Reference Calculator + logo: "foodsoft" + lib: + render_pdf: + page: Page %{number} of %{count} + login: + accept_invitation: + body: "You are invited to be part of the foodcoop %{foodcoop} as a member of the group %{group}.
If you want to participate, please fill in this form.
Naturally, your information wll not be shared with third parties for any reason. You can decide how much of your personal information should be visible for everyone. 'All' means all Foodcoop-members. Please note that the administrators do have access to your information.
" + submit: Create a Foodsoft account + title: Invitation to %{name} + controller: + accept_invitation: + notice: Congratulations, your account was created. You can login now. + error_group_invalid: The group in which you were invited doesn’t exist anymore. + error_invite_invalid: Your invite is not valid (anymore). + error_token_invalid: Invalid or expired token. Please try again. + reset_password: + notice: If your email is registered here, you will receive a message with a link to reset your password. You may need to check your spam folder. + update_password: + notice: Your password was updated. You can login now. + forgot_password: + body: "No problem, you can choose a new password.
Please fill in the email address with which you are registered here. Then you will receive an email with further instructions.
" + submit: Request new password + title: Forgot password? + new_password: + body: "Please fill in the new password for %{user}
" + submit: Save new password + title: New password + mailer: + dateformat: "%d %b" + feedback: + header: "%{user} wrote at %{date}:" + subject: Feedback for Foodsoft + group_order_invoice: + subject: Order group invoice for %{group} at %{supplier} + text: | + Dear order group %{group}, + + The collective order at %{supplier} has just been settled and invoices have been created for the respective order groups. + Attached you will find your invoice. + + Best regards from %{foodcoop} + from_via_foodsoft: "%{name} via Foodsoft" + invite: + subject: Invitation to the Foodcoop + text: | + Hi! + + %{user} <%{mail}> has invited you to join the group "%{group}". + To accept the invitation and to join the foodcoop please follow this link: %{link} + This link works only once and expires on %{expires}. + + + Greetings, your Foodsoft Team! + negative_balance: + subject: Negative account balance + text: | + Dear %{group}, + + Your account balance has dropped below zero due to a booking on %{when}: %{balance} + + There was a charge of %{amount} for "%{note}" by %{user}. + + Please deposit your account as soon as possible. + + + + Kind regards from %{foodcoop}. + not_enough_users_assigned: + subject: '"%{task}" still needs people!' + text: | + Dear %{user}, + + The Task '%{task}' of your working group is due on %{when}, + and could use some more contributors! + + If you haven’t assigned yourself to this task yet it’s your chance now: + + %{workgroup_tasks_url} + + Your Tasks: %{user_tasks_url} + order_result: + subject: 'Order closed: %{name}' + text0: | + Dear %{ordergroup}, + + The order for "%{order}" has been closed by %{user} on %{when}. + text1: | + It can be presumable be picked up on %{pickup}. + text2: | + The following articles have been ordered for your ordergroup: + text3: |- + o Total sum: %{sum} + + You can view the order online: %{order_url} + + + Kind regards from %{foodcoop}. + order_received: + subject: 'Order delivery registered: %{name}' + text0: | + Dear %{ordergroup}, + + the order for "%{order}" has been received. + abundant_articles: Received too much + scarce_articles: Received too little + article_details: | + o %{name}: + -- Ordered: %{ordered} x %{unit} + -- Received: %{received} x %{unit} + order_result_supplier: + subject: New order for %{name} + text: | + Hi! + + Foodcoop %{foodcoop} would like to place an order. + + Please find a PDF and spreadsheet attached. + + Kind regards, + %{user} + %{foodcoop} + reset_password: + subject: New password for %{username} + text: | + Hi %{user}, + + You have (or someone else has) requested a new password. + In order to choose a new password follow this link: %{link} + This link works only once and expires on %{expires}. + If you don't want to change your password, just ignore this message. Your password hasn't been changed yet. + + + Greetings, your Foodsoft Team! + upcoming_tasks: + nextweek: 'Tasks for the next week:' + subject: Tasks are due! + text0: | + Dear %{user}, + + You are asigned to the task "%{task}". This task is due by tomorrow (%{when})! + text1: | + My tasks: %{user_tasks_url} + + + Kind regards from %{foodcoop}. + welcome: + subject: Welcome to the Foodcoop + text0: | + Dear %{user}, + + a new Foodsoft account has been created for you. + text1: | + In order to choose a new password follow this link: %{link} + This link works only once and expires on %{expires}. + You can always use "Forgot password?" to get a new link. + + + Kind regards from %{foodcoop}. + messages_mailer: + foodsoft_message: + footer: | + Reply: %{reply_url} + See message online: %{msg_url} + Messaging options: %{profile_url} + footer_group: | + Sent to group: %{group} + model: + delivery: + each_stock_article_must_be_unique: Each stock article must not be listed more than once. + financial_transaction: + foodcoop_name: Foodcoop + financial_transaction_type: + no_delete_last: At least one financial transaction type must exist. + group_order: + stock_ordergroup_name: Stock (%{user}) + invoice: + invalid_mime: has an invalid MIME type (%{mime}) + membership: + no_admin_delete: Membership can not be withdrawn as you are the last administrator. + order_article: + error_price: must be specified and have a current price price + user: + no_ordergroup: no ordergroup + group_order_article: + order_closed: Order is closed and cannot be modified + navigation: + admin: + config: Configuration + finance: Finances + home: Overview + mail_delivery_status: Email problems + ordergroups: Ordergroups + title: Administration + users: Users + workgroups: Workgroups + articles: + categories: Categories + stock: Stock + suppliers: Suppliers/articles + title: Articles + dashboard: Dashboard + finances: + accounts: Manage accounts + balancing: Account orders + bank_accounts: Bank Accounts + home: Overview + invoices: Invoices + title: Finances + foodcoop: Foodcoop + members: Members + ordergroups: Ordergroups + orders: + archive: My Orders + manage: Manage orders + ordering: Place order! + pickups: Pickup days + title: Orders + tasks: Tasks + workgroups: Workgroups + number: + percentage: + format: + strip_insignificant_zeros: true + order_articles: + edit: + stock_alert: The price of stock articles cannot be changed! + title: Update article + new: + title: Add delivered article to order + ordergroups: + edit: + title: Edit ordergroups + index: + title: Ordergroups + model: + error_single_group: "%{user} is already a member of another ordergroup" + invalid_balance: is not a valid number + orders: + articles: + article_count: 'Ordered articles:' + prices: Net/gross price + prices_sum: 'Sum (net/gross price):' + units_full: Full units + units_ordered: Units ordered + create: + notice: The order was created. + edit: + title: 'Edit order: %{name}' + edit_amount: + field_locked_title: The distribution of this article among the ordergroups was changed manually. This field is locked to protect those changes. To redistribute and overwrite those changes, press the unlock button and change the amount. + field_unlocked_title: The distribution of this article among the ordergroups was changed manually. When you change the amount, those manual changes will be overwritten. + edit_amounts: + no_articles_available: No articles to add. + set_all_to_zero: Set all to zero + fax: + amount: Amount + articles: Articles + delivery_day: Delivery day + heading: Order for %{name} + name: Name + number: Number + to_address: Shipping address + finish: + notice: The order has been closed. + form: + ignore_warnings: Ignore warnings + prices: Prices (net/FC) + select_all: Select all + stockit: In stock + title: Article + index: + action_end: Close + action_receive: Receive + confirm_delete: Do you really want to delete the order? + confirm_end: Do you really want to close the order %{order}? There is no going back. + new_order: Create new order + no_open_or_finished_orders: There are currently no open or closed orders. + orders_finished: Closed + orders_open: Open + orders_settled: Settled + not_closed: Order not yet settled + title: Manage orders + model: + close_direct_message: Order settled without charging member accounts. + error_boxfill_before_ends: must be after the box-fill date (or remain empty) + error_closed: Order was already settled + error_nosel: At least one article must be selected. You may want to delete the order instead? + error_starts_before_boxfill: must be after the start date (or remain empty) + error_starts_before_ends: must be after the start date (or remain empty) + notice_close: 'Order: %{name}, until %{ends}' + stock: Stock + warning_ordered: 'Warning: articles marked red have already been ordered within this open order. If you uncheck them here, all existing orders of these articles will be deleted. To proceed, confirm below.' + warning_ordered_stock: 'Warning: Articles marked red have already been ordered/purchased within this open stock order. If you uncheck them here, all existing orders/purchases of these articles will be deleted and it will not be accounted for them. Confirm below to proceed.' + new: + title: Create new order + receive: + add_article: Add article + consider_member_tolerance: consider tolerance + notice: 'Order received: %{msg}' + notice_none: No new articles to receive + paragraph: If the ordered and received amount are the same, the corresponding fields can be empty. It's still good practice to enter all fields, since this provides an easy way to verify that all articles have been checked. + rest_to_stock: rest to stock + submit: Receive order + surplus_options: 'Distribution options:' + title: Receiving %{order} + send_to_supplier: + notice: The order has been sent to the supplier. + show: + action_end: Close! + amounts: 'Net/gross sum:' + articles: Article overview + articles_ordered: 'Ordered articles:' + comments: + title: Comments + comments_link: Comments + confirm_delete: Do you really want to delete the order? + confirm_end: |- + Do you really want to close the order %{order}? + There is no going back. + confirm_send_to_supplier: The order has been sent to the supplier already on %{when}. Do you really want to send it again? + create_invoice: Add invoice + description1_order: "%{state} order from %{supplier} opened by %{who}," + description1_period: + pickup: and can be picked up on %{pickup} + starts: open from %{starts} + starts_ends: open from %{starts} until %{ends} + description2: "%{ordergroups} ordered %{article_count} articles, with a total value of %{net_sum} / %{gross_sum} (net / gross)." + description3: " Additional deposit of %{net_deposit} / %{deposit} (net / gross)." + group_orders: 'Group orders:' + search_placeholder: + articles: Search for articles... + default: Search for articles... + groups: Search for ordergroups... + search_reset: Reset search + send_to_supplier: Send to supplier + show_invoice: Show invoice + sort_article: Sorted in articles + sort_group: Sorted in groups + stock_order: Stock Order + title: 'Order: %{name}' + warn_not_closed: Warning, order is not yet settled. + state: + closed: settled + finished: closed + open: open + received: received + update: + notice: The order was updated. + update_order_amounts: + msg1: "%{count} articles (%{units} units) updated" + msg2: "%{count} (%{units}) using tolerance" + msg4: "%{count} (%{units}) left over" + pickups: + document: + empty_selection: At least one order must be selected. + filename: Pickup for %{date} + invalid_document: Invalid document type + title: Pickup for %{date} + index: + article_pdf: Article PDF + group_pdf: Group PDF + matrix_pdf: Matrix PDF + title: Pickup days + sessions: + logged_in: Logged in! + logged_out: Logged out! + login_invalid_email: Invalid email address or password + login_invalid_nick: Invalid username or password + new: + forgot_password: Forgot password? + login: Login + nojs: Attention, cookies and javascript have to be activated! Please switch off %{link}. + noscript: NoScript + title: Foodsoft login + shared: + articles: + ordered: Ordered + ordered_desc: Number of articles as ordered by member (amount + tolerance) + received: Received + received_desc: Number of articles that (will be) received by member + articles_by: + price: Total price + price_sum: Sum + group: + access: Access to + activated: activated + apple_limit: Apple points order limit + break: from %{start} to %{end} + deactivated: deactivated + group_form_fields: + search: Search ... + search_user: Search user + user_not_found: No user found + open_orders: + no_open_orders: There are no current orders + not_enough_apples: Attention your ordergroup has too few apple points to place an order! + title: Current orders + total_sum: Total sum + who_ordered: Who ordered? + order_download_button: + article_pdf: Article PDF + download_file: Download file + fax_csv: Fax CSV + fax_pdf: Fax PDF + fax_txt: Fax text + group_pdf: Group PDF + matrix_pdf: Matrix PDF + title: Download + task_list: + accept_task: Accept task + done: Done + done_q: Done? + mark_done: Mark task as done + reject_task: Reject task + who: Who is doing it? + who_hint: "(How much are still needed?)" + user_form_fields: + contact_address_hint: The address of your ordergroup. If you update this, it changes for other members of the ordergroup as well. + messagegroups: Join or leave message groups + workgroup_members: + title: Group memberships + simple_form: + error_notification: + default_message: Errors were found. Please check the form. + hints: + article: + unit: e.g. KG or 1L or 500g + article_category: + description: comma-separated list of category names recognised at import/synchronisation + order_article: + units_to_order: If you change the total amount of delivered units, you also have to change individual group amounts by clicking on the article name. They will not be automatically recalculated and so ordergroups may be accounted for articles that were not delivered! + update_global_price: Also update the price of future orders + stock_article: + copy: + name: Please modify + edit_stock_article: + price: "Suppliers of the external database are displayed here.
You can import external suppliers by subscribing (see below).
A new supplier will be created and connected to the external database.
" + subscribe: Subscribe + subscribe_again: Subscribe again + supplier: Supplier + title: External lists + show: + last_deliveries: Recent deliveries + last_orders: Last orders + new_delivery: New delivery + show_deliveries: Show all + update: + notice: Supplier was updated + tasks: + accept: + notice: You have accepted the task + archive: + title: Task archive + create: + notice: Task has been created + destroy: + notice: Task has been deleted + edit: + submit_periodic: Save recurring task + title: Edit task + title_periodic: Edit recurring task + warning_periodic: "Warning: This task is part of a group of recurring tasks. When saving it will be excluded from the group and it will be converted to a regular task." + error_not_found: No workgroup found + form: + search: + hint: Search for user + noresult: No user found + placeholder: Search ... + submit: + periodic: Save recurring task + index: + show_group_tasks: Show group tasks + title: Tasks + title_non_group: Tasks for all! + nav: + all_tasks: All tasks + archive: Completed tasks (archive) + group_tasks: Group tasks + my_tasks: My tasks + new_task: Create new task + pages: Pages + new: + submit_periodic: Create recurring task + title: Create new task + repeated: Task is recurring + set_done: + notice: The state of the task has been updated + show: + accept_task: Accept task + confirm_delete_group: Really delete this and all subsequent tasks? + confirm_delete_single: Are you sure you want to delete the task? + confirm_delete_single_from_group: Are you sure you want to delete this task (and keep related recurring tasks)? + delete_group: Delete task and subsequent + edit_group: Edit recurring + hours: "%{count}h" + mark_done: Mark task as done + reject_task: Reject task + title: Show task + update: + notice: Task has been updated + notice_converted: Task has been updated and was converted to a non-repeating task. + user: + more: Nothing to do? %{tasks_link} are tasks for sure. + tasks_link: Here + title: My tasks + title_accepted: Accepted tasks + title_open: Open tasks + workgroup: + title: Tasks for %{workgroup} + title_all: All group tasks + ui: + actions: Actions + back: Back + cancel: Cancel + close: Close + confirm_delete: Do you really want to delete %{name}? + confirm_restore: Do you really want to restore %{name}? + copy: Copy + delete: Delete + download: Download + edit: Edit + marks: + close: "×" + success: + move: Move + or_cancel: or cancel + please_wait: Please wait... + restore: Restore + save: Save + search_placeholder: Search ... + show: Show + views: + pagination: + first: "«" + last: "»" + next: "›" + previous: "‹" + truncate: "..." + workgroups: + edit: + title: Edit workgroup + error_last_admin_group: The last group with admin rights may not be deleted + error_last_admin_role: Admin role for the last group with admin rights cannot be withdrawn + index: + title: Workgroups + update: + notice: Workgroup was updated + time: + formats: + foodsoft_datetime: "%Y-%m-%d %H:%M" + file: "%Y-%d-%B" diff --git a/plugins/automatic_invoices/config/routes.rb b/plugins/automatic_invoices/config/routes.rb new file mode 100644 index 00000000..caa5da8d --- /dev/null +++ b/plugins/automatic_invoices/config/routes.rb @@ -0,0 +1,7 @@ +Rails.application.routes.draw do + post 'finance/group_order_invoice', to: 'group_order_invoices#create_multiple' + + get 'orders/:order_id/group_order_invoices/download_all', to: 'group_order_invoices#download_all', as: 'download_all_group_order_invoices' + + resources :group_order_invoices +end diff --git a/plugins/automatic_invoices/db/migrate/20211208142719_create_group_order_invoices.rb b/plugins/automatic_invoices/db/migrate/20211208142719_create_group_order_invoices.rb new file mode 100644 index 00000000..b0aa13f7 --- /dev/null +++ b/plugins/automatic_invoices/db/migrate/20211208142719_create_group_order_invoices.rb @@ -0,0 +1,13 @@ +class CreateGroupOrderInvoices < ActiveRecord::Migration[5.2] + def change + create_table :group_order_invoices do |t| + t.integer :group_order_id + t.bigint :invoice_number, unique: true, limit: 8 + t.date :invoice_date + t.string :payment_method + + t.timestamps + end + add_index :group_order_invoices, :group_order_id, unique: true + end +end diff --git a/plugins/automatic_invoices/db/migrate/20230822120005_add_customer_number_to_group.rb b/plugins/automatic_invoices/db/migrate/20230822120005_add_customer_number_to_group.rb new file mode 100644 index 00000000..9b4c2278 --- /dev/null +++ b/plugins/automatic_invoices/db/migrate/20230822120005_add_customer_number_to_group.rb @@ -0,0 +1,5 @@ +class AddCustomerNumberToGroup < ActiveRecord::Migration[7.0] + def change + add_column :groups, :customer_number, :string, unique: true + end +end diff --git a/plugins/automatic_invoices/foodsoft_automatic_invoices.gemspec b/plugins/automatic_invoices/foodsoft_automatic_invoices.gemspec new file mode 100644 index 00000000..acf82674 --- /dev/null +++ b/plugins/automatic_invoices/foodsoft_automatic_invoices.gemspec @@ -0,0 +1,19 @@ +$:.push File.expand_path('lib', __dir__) + +# Maintain your gem's version: +require 'foodsoft_automatic_invoices/version' + +# Describe your gem and declare its dependencies: +Gem::Specification.new do |s| + s.name = 'foodsoft_automatic_invoices' + s.version = FoodsoftAutomaticInvoices::VERSION + s.authors = ['viehlieb'] + s.email = ['pf@pragma-shift.net'] + s.summary = "Foodsoft plugin to enhance foodsoft's accounting capabilities and to create and automatically deliver invoice pdfs for accounted orders." + s.description = '' + + s.files = Dir['{app,config,db,spec,lib}/**/**/**/*'] + ['Rakefile', 'README.md'] + + s.add_dependency 'rails' + s.add_dependency 'deface', '~> 1.9' +end diff --git a/plugins/automatic_invoices/lib/foodsoft_automatic_invoices.rb b/plugins/automatic_invoices/lib/foodsoft_automatic_invoices.rb new file mode 100644 index 00000000..0132b685 --- /dev/null +++ b/plugins/automatic_invoices/lib/foodsoft_automatic_invoices.rb @@ -0,0 +1,10 @@ +require 'deface' +require 'foodsoft_automatic_invoices/engine' +require 'foodsoft_automatic_invoices/send_group_order_invoice_pdf' + + +module FoodsoftAutomaticInvoices + def self.enabled? + FoodsoftConfig[:use_automatic_invoices] + end +end diff --git a/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/engine.rb b/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/engine.rb new file mode 100644 index 00000000..1f726353 --- /dev/null +++ b/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/engine.rb @@ -0,0 +1,12 @@ +module FoodsoftAutomaticInvoices + class Engine < ::Rails::Engine + + initializer 'automatic_invoices.assets.precompile' do |app| + app.config.assets.precompile += %w(group_orders.css.less) + end + + def default_foodsoft_config(cfg) + cfg[:use_automatic_invoices] = false + end + end +end diff --git a/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/send_group_order_invoice_pdf.rb b/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/send_group_order_invoice_pdf.rb new file mode 100644 index 00000000..dd2178fb --- /dev/null +++ b/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/send_group_order_invoice_pdf.rb @@ -0,0 +1,24 @@ +module FoodsoftAutomaticInvoices + module SendGroupOrderInvoicePdf + + extend ActiveSupport::Concern + + protected + + def create_invoice_pdf(group_order_invoice) + invoice_data = group_order_invoice.load_data_for_invoice + invoice_data[:title] = t('documents.group_order_invoice_pdf.title', supplier: invoice_data[:supplier]) + invoice_data[:no_footer] = true + GroupOrderInvoicePdf.new invoice_data + end + + def send_group_order_invoice_pdf(group_order_invoice) + pdf = create_invoice_pdf(group_order_invoice) + send_data pdf.to_pdf, filename: pdf.filename, type: 'application/pdf' + end + end +end + +ActiveSupport.on_load(:after_initialize) do + Concerns::SendOrderPdf.include FoodsoftAutomaticInvoices::SendGroupOrderInvoicePdf +end \ No newline at end of file diff --git a/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/version.rb b/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/version.rb new file mode 100644 index 00000000..8fc0e68a --- /dev/null +++ b/plugins/automatic_invoices/lib/foodsoft_automatic_invoices/version.rb @@ -0,0 +1,3 @@ +module FoodsoftAutomaticInvoices + VERSION = '0.0.1' +end diff --git a/plugins/automatic_invoices/spec/factories/group_order_invoice.rb b/plugins/automatic_invoices/spec/factories/group_order_invoice.rb new file mode 100644 index 00000000..89723873 --- /dev/null +++ b/plugins/automatic_invoices/spec/factories/group_order_invoice.rb @@ -0,0 +1,7 @@ +require 'factory_bot' + +FactoryBot.define do + factory :group_order_invoice do + group_order { create :group_order } + end +end diff --git a/plugins/automatic_invoices/spec/integration/group_order_invoices_spec.rb b/plugins/automatic_invoices/spec/integration/group_order_invoices_spec.rb new file mode 100644 index 00000000..f6ece77d --- /dev/null +++ b/plugins/automatic_invoices/spec/integration/group_order_invoices_spec.rb @@ -0,0 +1,72 @@ +require_relative '../spec_helper' + +feature GroupOrderInvoice, js: true do + let(:admin) { create :user, groups: [create(:workgroup, role_finance: true)] } + let(:user) { create :user, groups: [create(:ordergroup)] } + let(:article) { create :article, unit_quantity: 1 } + let(:order) { create :order, supplier: article.supplier, article_ids: [article.id], ends: Time.now } # need to ref article + let(:go) { create :group_order, order: order, ordergroup: user.ordergroup} + let(:oa) { order.order_articles.find_by_article_id(article.id) } + let(:ftt) { create :financial_transaction_type } + let(:goa) { create :group_order_article, group_order: go, order_article: oa } + + include ActiveJob::TestHelper + + before { login admin } + + after { clear_enqueued_jobs } + + it 'does not enqueue MailerJob when order is settled if tax_number or options not set' do + goa.update_quantities 2, 0 + oa.update_results! + visit confirm_finance_order_path(id: order.id) + click_link_or_button I18n.t('finance.balancing.confirm.clear') + expect(NotifyGroupOrderInvoiceJob).not_to have_been_enqueued + end + + it 'enqueues MailerJob when order is settled if tax_number or options are set' do + goa.update_quantities 2, 0 + oa.update_results! + order.reload + FoodsoftConfig[:group_order_invoices] = { use_automatic_invoices: true } + FoodsoftConfig[:contact][:tax_number] = 12_345_678 + visit confirm_finance_order_path(id: order.id, type: ftt) + expect(page).to have_selector(:link_or_button, I18n.t('finance.balancing.confirm.clear')) + click_link_or_button I18n.t('finance.balancing.confirm.clear') + expect(NotifyGroupOrderInvoiceJob).to have_been_enqueued + end + + it 'generates Group Order Invoice when order is closed if tax_number is set' do + goa.update_quantities 2, 0 + oa.update_results! + FoodsoftConfig[:contact][:tax_number] = 12_345_678 + order.update!(state: 'closed') + go.reload + order.reload + visit finance_order_index_path + expect(page).to have_selector(:link_or_button, I18n.t('activerecord.attributes.group_order_invoice.links.generate')) + click_link_or_button I18n.t('activerecord.attributes.group_order_invoice.links.generate') + expect(GroupOrderInvoice.all.count).to eq(1) + end + + it 'generates multiple Group Order Invoice for order when order is closed if tax_number is set' do + goa.update_quantities 2, 0 + oa.update_results! + FoodsoftConfig[:contact][:tax_number] = 12_345_678 + order.update!(state: 'closed') + order.reload + visit finance_order_index_path + expect(page).to have_selector(:link_or_button, I18n.t('activerecord.attributes.group_order_invoice.links.generate_with_date')) + click_link_or_button I18n.t('activerecord.attributes.group_order_invoice.links.generate_with_date') + expect(GroupOrderInvoice.all.count).to eq(1) + end + + it 'does not generate Group Order Invoice when order is closed if tax_number not set' do + goa.update_quantities 2, 0 + oa.update_results! + order.update!(state: 'closed') + order.reload + visit finance_order_index_path + expect(page).to have_content(I18n.t('activerecord.attributes.group_order_invoice.tax_number_not_set')) + end +end diff --git a/plugins/automatic_invoices/spec/models/article_spec.rb b/plugins/automatic_invoices/spec/models/article_spec.rb new file mode 100644 index 00000000..91a2f8ea --- /dev/null +++ b/plugins/automatic_invoices/spec/models/article_spec.rb @@ -0,0 +1,168 @@ +require_relative '../spec_helper' + +describe Article do + let(:supplier) { create(:supplier) } + let(:article) { create(:article, supplier: supplier) } + + it 'has a unique name' do + article2 = build(:article, supplier: supplier, name: article.name) + expect(article2).to be_invalid + end + + it 'can be deleted' do + expect(article).not_to be_deleted + article.mark_as_deleted + expect(article).to be_deleted + end + + describe 'convert units' do + it 'returns nil when equal' do + expect(article.convert_units(article)).to be_nil + end + + it 'returns false when invalid unit' do + article1 = build(:article, supplier: supplier, unit: 'invalid') + expect(article.convert_units(article1)).to be false + end + + it 'returns false if unit = 0' do + article1 = build(:article, supplier: supplier, unit: '1kg', price: 2, unit_quantity: 1) + article2 = build(:article, supplier: supplier, unit: '0kg', price: 2, unit_quantity: 1) + expect(article1.convert_units(article2)).to be false + end + + it 'returns false if unit becomes zero because of , symbol in unit format' do + article1 = build(:article, supplier: supplier, unit: '0,8kg', price: 2, unit_quantity: 1) + article2 = build(:article, supplier: supplier, unit: '0,9kg', price: 2, unit_quantity: 1) + expect(article1.convert_units(article2)).to be false + end + + it 'converts from ST to KI (german foodcoops legacy)' do + article1 = build(:article, supplier: supplier, unit: 'ST') + article2 = build(:article, supplier: supplier, name: 'banana 10-12 St', price: 12.34, unit: 'KI') + new_price, new_unit_quantity = article1.convert_units(article2) + expect(new_unit_quantity).to eq 10 + expect(new_price).to eq 1.23 + end + + it 'converts from g to kg' do + article1 = build(:article, supplier: supplier, unit: 'kg') + article2 = build(:article, supplier: supplier, unit: 'g', price: 0.12, unit_quantity: 1500) + new_price, new_unit_quantity = article1.convert_units(article2) + expect(new_unit_quantity).to eq 1.5 + expect(new_price).to eq 120 + end + end + + it 'computes changed article attributes' do + article2 = build(:article, supplier: supplier, name: 'banana') + expect(article.unequal_attributes(article2)[:name]).to eq 'banana' + end + + it 'computes the gross price correctly' do + article.deposit = 0 + article.tax = 12 + expect(article.gross_price).to eq((article.price * 1.12).round(2)) + article.deposit = 1.20 + if FoodsoftConfig[:group_order_invoices]&.[](:separate_deposits) + expect(article.gross_price_without_deposit).to eq((article.price * 1.12 + 1.20).round(2)) + expect(article.gross_price).to eq(((article.price + 1.20) * 1.12).round(2)) + end + end + + it 'gross price >= net price' do + expect(article.gross_price).to be >= article.price + end + + [[nil, 1], + [0, 1], + [5, 1.05], + [42, 1.42], + [100, 2]].each do |price_markup, percent| + it "computes the fc price with price_markup #{price_markup} correctly" do + FoodsoftConfig.config['price_markup'] = price_markup + expect(article.fc_price).to eq((article.gross_price * percent).round(2)) + end + end + it 'knows when it is deleted' do + expect(supplier.deleted?).to be false + supplier.mark_as_deleted + expect(supplier.deleted?).to be true + end + + it 'keeps a price history' do + expect(article.article_prices.map(&:price)).to eq([article.price]) + oldprice = article.price + sleep 1 # so that the new price really has a later creation time + article.price += 1 + article.save! + expect(article.article_prices.reload.map(&:price)).to eq([article.price, oldprice]) + end + + it 'is not in an open order by default' do + expect(article.in_open_order).to be_nil + end + + it 'is knows its open order' do + order = create(:order, supplier: supplier, article_ids: [article.id]) + expect(article.in_open_order).to eq(order) + end + + it 'has no shared article by default' do + expect(article.shared_article).to be_nil + end + + describe 'connected to a shared database', type: :feature do + let(:shared_article) { create(:shared_article) } + let(:supplier) { create(:supplier, shared_supplier_id: shared_article.supplier_id) } + let(:article) { create(:article, supplier: supplier, order_number: shared_article.order_number) } + + it 'can be found in the shared database' do + expect(article.shared_article).not_to be_nil + end + + it 'can find updates' do + changed = article.shared_article_changed? + expect(changed).not_to be_falsey + expect(changed.length).to be > 1 + end + + it 'can be synchronised' do + # TODO: move article sync from supplier to article + article # need to reference for it to exist when syncing + updated_article = supplier.sync_all[0].select { |s| s[0].id == article.id }.first[0] + article.update(updated_article.attributes.reject { |k, _v| %w[id type].include?(k) }) + expect(article.name).to eq(shared_article.name) + # now synchronising shouldn't change anything anymore + expect(article.shared_article_changed?).to be_falsey + end + + it 'does not need to synchronise an imported article' do + article = shared_article.build_new_article(supplier) + article.article_category = create :article_category + expect(article.shared_article_changed?).to be_falsey + end + + it 'adapts to foodcoop units when synchronising' do + shared_article.unit = '1kg' + shared_article.unit_quantity = 1 + shared_article.save! + article = shared_article.build_new_article(supplier) + article.article_category = create :article_category + article.unit = '200g' + article.shared_updated_on -= 1 # to make update do something + article.save! + # TODO: get sync functionality in article + updated_article = supplier.sync_all[0].select { |s| s[0].id == article.id }.first[0] + article.update!(updated_article.attributes.reject { |k, _v| %w[id type].include?(k) }) + expect(article.unit).to eq '200g' + expect(article.unit_quantity).to eq 5 + expect(article.price).to be_within(0.005).of(shared_article.price / 5) + end + + it 'does not synchronise when it has no order number' do + article.update(order_number: nil) + expect(supplier.sync_all).to eq [[], [], []] + end + end +end diff --git a/plugins/automatic_invoices/spec/models/group_order_invoice_spec.rb b/plugins/automatic_invoices/spec/models/group_order_invoice_spec.rb new file mode 100644 index 00000000..24bfcf7e --- /dev/null +++ b/plugins/automatic_invoices/spec/models/group_order_invoice_spec.rb @@ -0,0 +1,59 @@ +require_relative '../spec_helper' + +describe GroupOrderInvoice do + let(:user) { create :user, groups: [create(:ordergroup)] } + let(:supplier) { create :supplier } + let(:article) { create :article, supplier: supplier } + let(:order) { create :order } + let(:group_order) { create :group_order, order: order, ordergroup: user.ordergroup } + + describe 'erroneous group order invoice' do + let(:goi) { create :group_order_invoice, group_order_id: group_order.id } + it 'does not create group order invoice if tax_number not set' do + expect { goi }.to raise_error(ActiveRecord::RecordInvalid, /.*/) + end + end + + describe 'valid group order invoice' do + before do + FoodsoftConfig[:contact][:tax_number] = 123_457_8 + end + + invoice_number1 = Time.now.strftime("%Y%m%d") + '0001' + invoice_number2 = Time.now.strftime("%Y%m%d") + '0002' + + let(:user2) { create :user, groups: [create(:ordergroup)] } + + let(:goi1) { create :group_order_invoice, group_order_id: group_order.id } + let(:goi2) { create :group_order_invoice, group_order_id: group_order.id } + + let(:group_order2) { create :group_order, order: order, ordergroup: user2.ordergroup } + + let(:goi3) { create :group_order_invoice, group_order_id: group_order2.id } + let(:goi4) { create :group_order_invoice, group_order_id: group_order2.id, invoice_number: invoice_number1 } + + it 'creates group order invoice if tax_number is set' do + expect(goi1).to be_valid + end + + it 'sets invoice_number according to date' do + number = Time.now.strftime("%Y%m%d") + '0001' + expect(goi1.invoice_number).to eq(number.to_i) + end + + it 'fails to create if group_order_id is used multiple times for creation' do + expect(goi1.group_order.id).to eq(group_order.id) + expect { goi2 }.to raise_error(ActiveRecord::RecordNotUnique) + end + + it 'creates two different group order invoice with different invoice_numbers' do + expect(goi1.invoice_number).to eq(invoice_number1.to_i) + expect(goi3.invoice_number).to eq(invoice_number2.to_i) + end + + it 'fails to create two different group order invoice with same invoice_numbers' do + goi1 + expect { goi4 }.to raise_error(ActiveRecord::RecordInvalid) + end + end +end diff --git a/plugins/current_orders/app/controllers/current_orders/articles_controller.rb b/plugins/current_orders/app/controllers/current_orders/articles_controller.rb index ef23f332..51111f3f 100644 --- a/plugins/current_orders/app/controllers/current_orders/articles_controller.rb +++ b/plugins/current_orders/app/controllers/current_orders/articles_controller.rb @@ -1,6 +1,6 @@ class CurrentOrders::ArticlesController < ApplicationController before_action :authenticate_orders - before_action :find_order_and_order_article, only: [:index, :show] + before_action :find_order_and_order_article, only: %i[index show] def index # sometimes need to pass id as parameter for forms @@ -26,11 +26,11 @@ class CurrentOrders::ArticlesController < ApplicationController def find_order_and_order_article @current_orders = Order.finished_not_closed - unless params[:order_id].blank? + if params[:order_id].blank? + @order_articles = OrderArticle.where(order_id: @current_orders.all.map(&:id)) + else @order = Order.find(params[:order_id]) @order_articles = @order.order_articles - else - @order_articles = OrderArticle.where(order_id: @current_orders.all.map(&:id)) end @q = OrderArticle.ransack(params[:q]) @order_articles = @order_articles.ordered.merge(@q.result).includes(:article, :article_price) diff --git a/plugins/current_orders/app/controllers/current_orders/group_orders_controller.rb b/plugins/current_orders/app/controllers/current_orders/group_orders_controller.rb index 717ebba8..945bfd30 100644 --- a/plugins/current_orders/app/controllers/current_orders/group_orders_controller.rb +++ b/plugins/current_orders/app/controllers/current_orders/group_orders_controller.rb @@ -4,10 +4,10 @@ class CurrentOrders::GroupOrdersController < ApplicationController def index # XXX code duplication lib/foodsoft_current_orders/app/controllers/current_orders/ordergroups_controller.rb - @order_ids = Order.where(state: ['open', 'finished']).all.map(&:id) - @goas = GroupOrderArticle.includes(:group_order => :ordergroup).includes(:order_article) + @order_ids = Order.where(state: %w[open finished]).all.map(&:id) + @goas = GroupOrderArticle.includes(group_order: :ordergroup).includes(:order_article) .where(group_orders: { order_id: @order_ids, ordergroup_id: @ordergroup.id }).ordered - @articles_grouped_by_category = @goas.includes(:order_article => { :article => :article_category }) + @articles_grouped_by_category = @goas.includes(order_article: { article: :article_category }) .order('articles.name') .group_by { |a| a.order_article.article.article_category.name } .sort { |a, b| a[0] <=> b[0] } @@ -18,8 +18,8 @@ class CurrentOrders::GroupOrdersController < ApplicationController # XXX code duplication from GroupOrdersController def ensure_ordergroup_member @ordergroup = @current_user.ordergroup - if @ordergroup.nil? - redirect_to root_url, :alert => I18n.t('group_orders.errors.no_member') - end + return unless @ordergroup.nil? + + redirect_to root_url, alert: I18n.t('group_orders.errors.no_member') end end diff --git a/plugins/current_orders/app/controllers/current_orders/ordergroups_controller.rb b/plugins/current_orders/app/controllers/current_orders/ordergroups_controller.rb index 708016a9..94390a0a 100644 --- a/plugins/current_orders/app/controllers/current_orders/ordergroups_controller.rb +++ b/plugins/current_orders/app/controllers/current_orders/ordergroups_controller.rb @@ -1,6 +1,6 @@ class CurrentOrders::OrdergroupsController < ApplicationController before_action :authenticate_orders - before_action :find_group_orders, only: [:index, :show] + before_action :find_group_orders, only: %i[index show] def index # sometimes need to pass id as parameter for forms @@ -34,8 +34,11 @@ class CurrentOrders::OrdergroupsController < ApplicationController @all_ordergroups.sort_by! { |o| @ordered_group_ids.include?(o.id) ? o.name : "ZZZZZ#{o.name}" } @ordergroup = Ordergroup.find(params[:id]) unless params[:id].nil? - @goas = GroupOrderArticle.includes(:group_order, :order_article => [:article, :article_price]) - .where(group_orders: { order_id: @order_ids, ordergroup_id: @ordergroup.id }).ordered.all unless @ordergroup.nil? + return if @ordergroup.nil? + + @goas = GroupOrderArticle.includes(:group_order, order_article: %i[article article_price]) + .where(group_orders: { order_id: @order_ids, + ordergroup_id: @ordergroup.id }).ordered.all end helper_method \ diff --git a/plugins/current_orders/app/documents/multiple_orders_by_articles.rb b/plugins/current_orders/app/documents/multiple_orders_by_articles.rb index 48d8a058..95b2e3b6 100644 --- a/plugins/current_orders/app/documents/multiple_orders_by_articles.rb +++ b/plugins/current_orders/app/documents/multiple_orders_by_articles.rb @@ -77,11 +77,11 @@ class MultipleOrdersByArticles < OrderPdf .includes(:article).references(:article) .reorder('order_articles.order_id, articles.name') .preload(:article_price) # preload not join, just in case it went missing - .preload(:order, :group_order_articles => { :group_order => :ordergroup }) + .preload(:order, group_order_articles: { group_order: :ordergroup }) end - def each_order_article - order_articles.find_each_with_order(batch_size: BATCH_SIZE) { |oa| yield oa } + def each_order_article(&block) + order_articles.find_each_with_order(batch_size: BATCH_SIZE, &block) end def group_order_articles_for(order_article) @@ -90,7 +90,7 @@ class MultipleOrdersByArticles < OrderPdf goas end - def each_group_order_article_for(group_order) - group_order_articles_for(group_order).each { |goa| yield goa } + def each_group_order_article_for(group_order, &block) + group_order_articles_for(group_order).each(&block) end end diff --git a/plugins/current_orders/app/documents/multiple_orders_by_groups.rb b/plugins/current_orders/app/documents/multiple_orders_by_groups.rb index 0c9eefa9..a09ef1d4 100644 --- a/plugins/current_orders/app/documents/multiple_orders_by_groups.rb +++ b/plugins/current_orders/app/documents/multiple_orders_by_groups.rb @@ -113,7 +113,7 @@ class MultipleOrdersByGroups < OrderPdf s end - def each_ordergroup + def each_ordergroup(&block) ordergroups.find_in_batches_with_order(batch_size: BATCH_SIZE) do |ordergroups| @group_order_article_batch = GroupOrderArticle .joins(:group_order) @@ -121,8 +121,8 @@ class MultipleOrdersByGroups < OrderPdf .where(group_orders: { ordergroup_id: ordergroups.map(&:id) }) .order('group_orders.order_id, group_order_articles.id') .preload(group_orders: { order: :supplier }) - .preload(order_article: [:article, :article_price, :order]) - ordergroups.each { |ordergroup| yield ordergroup } + .preload(order_article: %i[article article_price order]) + ordergroups.each(&block) end end @@ -130,7 +130,7 @@ class MultipleOrdersByGroups < OrderPdf @group_order_article_batch.select { |goa| goa.group_order.ordergroup_id == ordergroup.id } end - def each_group_order_article_for(ordergroup) - group_order_articles_for(ordergroup).each { |goa| yield goa } + def each_group_order_article_for(ordergroup, &block) + group_order_articles_for(ordergroup).each(&block) end end diff --git a/plugins/current_orders/app/helpers/current_orders_helper.rb b/plugins/current_orders/app/helpers/current_orders_helper.rb index 3bbab482..c62493a1 100644 --- a/plugins/current_orders/app/helpers/current_orders_helper.rb +++ b/plugins/current_orders/app/helpers/current_orders_helper.rb @@ -6,7 +6,9 @@ module CurrentOrdersHelper elsif funds == 0 I18n.t('helpers.current_orders.pay_none') else - content_tag :b, I18n.t('helpers.current_orders.pay_amount', amount: number_to_currency(-ordergroup.get_available_funds)) + content_tag :b, + I18n.t('helpers.current_orders.pay_amount', + amount: number_to_currency(-ordergroup.get_available_funds)) end end end diff --git a/plugins/current_orders/config/locales/de.yml b/plugins/current_orders/config/locales/de.yml index 4df36568..3e1cfeb8 100644 --- a/plugins/current_orders/config/locales/de.yml +++ b/plugins/current_orders/config/locales/de.yml @@ -10,6 +10,7 @@ de: counts: '%{ordergroups} Bestellgruppen bestellten %{articles} verschiedene Produkte.' no_selection: Wähle einen Artikel, um anzuzeigen wer ihn bestellt hat oder downloade eine Abholliste rechts. article_info: + origin_in: in %{origin} supplied_by: von %{supplier} supplied_and_made_by: produziert von %{manufacturer} supplied_by_made_by: von %{supplier} produziert von %{manufacturer} @@ -24,6 +25,8 @@ de: piece: St. unit: Einheit add_new: Bestellgruppe hinzufügen + show: + title: ! '%{name}' navigation: receive: In Empfang nehmen articles: Verteilen @@ -41,6 +44,7 @@ de: title: Artikel für Bestellgruppe payment_bar: account_balance: Kontostand + new_pin: PIN new_transaction: Neue Transaktion payment: ! 'Zahlung:' show: diff --git a/plugins/current_orders/config/locales/es.yml b/plugins/current_orders/config/locales/es.yml index 04b672b2..3ff1468a 100644 --- a/plugins/current_orders/config/locales/es.yml +++ b/plugins/current_orders/config/locales/es.yml @@ -1,5 +1,7 @@ es: config: + hints: + use_current_orders: Activar el plugin de current_orders. Permite a los miembros con el permiso de la orden cambiar la cantidad de miembros en múltiples pedidos, usando tres nuevas pantallas en el menú de pedidos. Especialmente útil para los días de recogida. keys: use_current_orders: Pantallas extra de distribución current_orders: @@ -23,6 +25,8 @@ es: piece: pieza unit: unidad add_new: Añade un grupo de pedido... + show: + title: ! '%{name}' navigation: receive: Recibe articles: Distribuye @@ -40,6 +44,7 @@ es: title: Artículos por grupo de pedido payment_bar: account_balance: Balance de cuenta + new_pin: PIN new_transaction: Nueva transacción payment: ! 'Pago:' show: diff --git a/plugins/current_orders/config/locales/tr.yml b/plugins/current_orders/config/locales/tr.yml new file mode 100644 index 00000000..7087f541 --- /dev/null +++ b/plugins/current_orders/config/locales/tr.yml @@ -0,0 +1,73 @@ +tr: + config: + hints: + use_current_orders: Şimdiki_siparişler eklentisini aktif et. Sipariş izni olan üyelerin, Siparişler menüsünde üç yeni ekran kullanarak birden çok siparişte üye miktarlarını değiştirmesine olanak tanır. Özellikle teslim alma günleri için faydalıdır. + keys: + use_current_orders: Ekstra dağıtım ekranları + current_orders: + articles: + article: + counts: '%{ordergroups} sipariş grubu, %{articles} farklı ürün sipariş etti.' + no_selection: Hangi üyenin ne sipariş ettiğini görmek için bir ürün seçin, veya sağ taraftan toplama listelerini indirin. + article_info: + origin_in: '%{origin} içinde' + supplied_by: '%{supplier} tarafından' + supplied_and_made_by: '%{manufacturer} tarafından yapıldı' + supplied_by_made_by: '%{supplier} tarafından sağlandı, %{manufacturer} tarafından yapıldı' + unit: '%{unit} başına' + from: '%{supplier} tarafından' + form: + article_placeholder: Ürünleri arayın... + current_orders: Tüm güncel siparişler + index: + title: Ürünleri dağıt + ordergroups: + piece: adet + unit: birim + add_new: Bir sipariş grubu ekleyin... + show: + title: ! '%{name}' + navigation: + receive: Teslim al + articles: Dağıtım + ordergroups: Üye siparişleri + group_orders: + index: + title: Mevcut siparişleriniz + ordergroups: + articles: + add_new: Yeni bir ürün ekleyin... + no_selection: Hangi sipariş grubunu göstermek istediğinizi seçin. + form: + ordergroup_placeholder: Bir sipariş grubu seçin... + index: + title: Ürünler - sipariş grubu için + payment_bar: + account_balance: Hesap bakiyesi + new_pin: PIN + new_transaction: Yeni işlem + payment: ! 'Ödeme:' + show: + title: '%{name} adına ürünler' + orders: + receive: + title: Siparişleri al + no_finished_orders: Şu anda alınacak sipariş yok. + documents: + multiple_orders_by_articles: + filename: Ürüne göre mevcut siparişler + title: Mevcut siparişler - ürüne göre + multiple_orders_by_groups: + filename: Gruba göre mevcut siparişler + title: Mevcut siparişler - gruba göre + helpers: + current_orders: + pay_done: Tamamen ödendi + pay_none: Ödenecek bir şey yok + pay_amount: Ödenecek tutar %{amount} + js: + current_orders: + articles: + above: '%{count} adet mevcut stoktan fazla' + below: '%{count} adet mevcut stokta kaldı' + equal: Tümü dağıtıldı diff --git a/plugins/current_orders/config/routes.rb b/plugins/current_orders/config/routes.rb index f642fc31..aeb2b014 100644 --- a/plugins/current_orders/config/routes.rb +++ b/plugins/current_orders/config/routes.rb @@ -1,27 +1,27 @@ Rails.application.routes.draw do scope '/:foodcoop' do namespace :current_orders do - resources :ordergroups, :only => [:index, :show] do + resources :ordergroups, only: %i[index show] do collection do get :show_on_group_order_article_create get :show_on_group_order_article_update end end - resources :articles, :only => [:index, :show] do + resources :articles, only: %i[index show] do collection do get :show_on_group_order_article_create end end - resource :orders, :only => [:show] do + resource :orders, only: [:show] do collection do get :my get :receive end end - resources :group_orders, :only => [:index] + resources :group_orders, only: [:index] end end end diff --git a/plugins/current_orders/foodsoft_current_orders.gemspec b/plugins/current_orders/foodsoft_current_orders.gemspec index c444fbec..f8e22ce6 100644 --- a/plugins/current_orders/foodsoft_current_orders.gemspec +++ b/plugins/current_orders/foodsoft_current_orders.gemspec @@ -1,20 +1,21 @@ -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('lib', __dir__) # Maintain your gem's version: -require "foodsoft_current_orders/version" +require 'foodsoft_current_orders/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "foodsoft_current_orders" + s.name = 'foodsoft_current_orders' s.version = FoodsoftCurrentOrders::VERSION - s.authors = ["wvengen"] - s.email = ["dev-voko@willem.engen.nl"] - s.homepage = "https://github.com/foodcoop-adam/foodsoft" - s.summary = "Quick support for working on all currently active orders in foodsoft." - s.description = "" + s.authors = ['wvengen'] + s.email = ['dev-voko@willem.engen.nl'] + s.homepage = 'https://github.com/foodcoop-adam/foodsoft' + s.summary = 'Quick support for working on all currently active orders in foodsoft.' + s.description = '' - s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"] + s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile', 'README.md'] - s.add_dependency "rails" - s.add_dependency "deface", "~> 1.0" + s.add_dependency 'rails' + s.add_dependency 'deface', '~> 1.0' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/plugins/current_orders/lib/foodsoft_current_orders.rb b/plugins/current_orders/lib/foodsoft_current_orders.rb index 5a9a7c82..8227bea4 100644 --- a/plugins/current_orders/lib/foodsoft_current_orders.rb +++ b/plugins/current_orders/lib/foodsoft_current_orders.rb @@ -1,5 +1,5 @@ -require "deface" -require "foodsoft_current_orders/engine" +require 'deface' +require 'foodsoft_current_orders/engine' module FoodsoftCurrentOrders def self.enabled? diff --git a/plugins/current_orders/lib/foodsoft_current_orders/engine.rb b/plugins/current_orders/lib/foodsoft_current_orders/engine.rb index 07427b56..c6236acb 100644 --- a/plugins/current_orders/lib/foodsoft_current_orders/engine.rb +++ b/plugins/current_orders/lib/foodsoft_current_orders/engine.rb @@ -4,12 +4,15 @@ module FoodsoftCurrentOrders return unless FoodsoftCurrentOrders.enabled? return if primary[:orders].nil? - cond = Proc.new { current_user.role_orders? } + cond = proc { current_user.role_orders? } [ SimpleNavigation::Item.new(primary, :stage_divider, nil, nil, class: 'divider', if: cond), - SimpleNavigation::Item.new(primary, :current_orders_receive, I18n.t('current_orders.navigation.receive'), context.receive_current_orders_orders_path, if: cond), - SimpleNavigation::Item.new(primary, :current_orders_articles, I18n.t('current_orders.navigation.articles'), context.current_orders_articles_path, if: cond), - SimpleNavigation::Item.new(primary, :current_orders_ordergroups, I18n.t('current_orders.navigation.ordergroups'), context.current_orders_ordergroups_path, if: cond) + SimpleNavigation::Item.new(primary, :current_orders_receive, I18n.t('current_orders.navigation.receive'), + context.receive_current_orders_orders_path, if: cond), + SimpleNavigation::Item.new(primary, :current_orders_articles, I18n.t('current_orders.navigation.articles'), + context.current_orders_articles_path, if: cond), + SimpleNavigation::Item.new(primary, :current_orders_ordergroups, + I18n.t('current_orders.navigation.ordergroups'), context.current_orders_ordergroups_path, if: cond) ].each { |i| primary[:orders].sub_navigation.items << i } end end diff --git a/plugins/current_orders/lib/foodsoft_current_orders/version.rb b/plugins/current_orders/lib/foodsoft_current_orders/version.rb index af58aa9c..9e916ba6 100644 --- a/plugins/current_orders/lib/foodsoft_current_orders/version.rb +++ b/plugins/current_orders/lib/foodsoft_current_orders/version.rb @@ -1,3 +1,3 @@ module FoodsoftCurrentOrders - VERSION = "0.0.1" + VERSION = '0.0.1' end diff --git a/plugins/discourse/Rakefile b/plugins/discourse/Rakefile index cb56e2e5..abec3d42 100755 --- a/plugins/discourse/Rakefile +++ b/plugins/discourse/Rakefile @@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__) load 'rails/tasks/engine.rake' Bundler::GemHelper.install_tasks @@ -34,4 +34,4 @@ Rake::TestTask.new(:test) do |t| t.verbose = false end -task :default => :test +task default: :test diff --git a/plugins/discourse/app/controllers/discourse_controller.rb b/plugins/discourse/app/controllers/discourse_controller.rb index 5a65f61c..0e62f14d 100644 --- a/plugins/discourse/app/controllers/discourse_controller.rb +++ b/plugins/discourse/app/controllers/discourse_controller.rb @@ -11,7 +11,7 @@ class DiscourseController < ApplicationController def redirect_to_with_payload(url, payload) base64_payload = Base64.strict_encode64 payload.to_query - sso = CGI::escape base64_payload + sso = CGI.escape base64_payload sig = get_hmac_hex_string base64_payload redirect_to "#{url}#{url.include?('?') ? '&' : '?'}sso=#{sso}&sig=#{sig}" end @@ -21,7 +21,7 @@ class DiscourseController < ApplicationController payload.symbolize_keys! end - def get_hmac_hex_string payload + def get_hmac_hex_string(payload) discourse_sso_secret = FoodsoftConfig[:discourse_sso_secret] OpenSSL::HMAC.hexdigest 'sha256', discourse_sso_secret, payload end diff --git a/plugins/discourse/app/controllers/discourse_login_controller.rb b/plugins/discourse/app/controllers/discourse_login_controller.rb index 1c8fe938..bd7a81e3 100644 --- a/plugins/discourse/app/controllers/discourse_login_controller.rb +++ b/plugins/discourse/app/controllers/discourse_login_controller.rb @@ -5,7 +5,7 @@ class DiscourseLoginController < DiscourseController def initiate discourse_url = FoodsoftConfig[:discourse_url] - nonce = SecureRandom.hex() + nonce = SecureRandom.hex return_sso_url = url_for(action: :callback, only_path: false) session[:discourse_sso_nonce] = nonce @@ -36,7 +36,7 @@ class DiscourseLoginController < DiscourseController user.save! login_and_redirect_to_return_to user, notice: I18n.t('discourse.callback.logged_in') - rescue => error - redirect_to login_url, alert: error.to_s + rescue StandardError => e + redirect_to login_url, alert: e.to_s end end diff --git a/plugins/discourse/app/controllers/discourse_sso_controller.rb b/plugins/discourse/app/controllers/discourse_sso_controller.rb index e8f742b6..04dc8d1c 100644 --- a/plugins/discourse/app/controllers/discourse_sso_controller.rb +++ b/plugins/discourse/app/controllers/discourse_sso_controller.rb @@ -17,7 +17,7 @@ class DiscourseSsoController < DiscourseController external_id: "#{FoodsoftConfig.scope}/#{current_user.id}", username: current_user.nick, name: current_user.name - rescue => error - redirect_to root_url, alert: error.to_s + rescue StandardError => e + redirect_to root_url, alert: e.to_s end end diff --git a/plugins/discourse/config/locales/es.yml b/plugins/discourse/config/locales/es.yml index f1e055d2..0da76a94 100644 --- a/plugins/discourse/config/locales/es.yml +++ b/plugins/discourse/config/locales/es.yml @@ -1,5 +1,6 @@ es: discourse: callback: + invalid_nonce: Nonce inválido invalid_signature: Firma inválida logged_in: Estás adentro! diff --git a/plugins/discourse/config/locales/tr.yml b/plugins/discourse/config/locales/tr.yml new file mode 100644 index 00000000..0cb231c8 --- /dev/null +++ b/plugins/discourse/config/locales/tr.yml @@ -0,0 +1,6 @@ +tr: + discourse: + callback: + invalid_nonce: Geçersiz nonce + invalid_signature: Geçersiz imza + logged_in: Giriş yapıldı! diff --git a/plugins/discourse/foodsoft_discourse.gemspec b/plugins/discourse/foodsoft_discourse.gemspec index 4400bcf4..1e6113ce 100644 --- a/plugins/discourse/foodsoft_discourse.gemspec +++ b/plugins/discourse/foodsoft_discourse.gemspec @@ -1,20 +1,21 @@ -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('lib', __dir__) # Maintain your gem's version: -require "foodsoft_discourse/version" +require 'foodsoft_discourse/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "foodsoft_discourse" + s.name = 'foodsoft_discourse' s.version = FoodsoftDiscourse::VERSION - s.authors = ["paroga"] - s.email = ["paroga@paroga.com"] - s.homepage = "https://github.com/foodcoops/foodsoft" - s.summary = "Discourse plugin for foodsoft." - s.description = "Allow SSO login via Discourse" + s.authors = ['paroga'] + s.email = ['paroga@paroga.com'] + s.homepage = 'https://github.com/foodcoops/foodsoft' + s.summary = 'Discourse plugin for foodsoft.' + s.description = 'Allow SSO login via Discourse' - s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"] + s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile', 'README.md'] - s.add_dependency "rails" - s.add_dependency "deface", "~> 1.0" + s.add_dependency 'rails' + s.add_dependency 'deface', '~> 1.0' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/plugins/discourse/lib/foodsoft_discourse/redirect_to_login.rb b/plugins/discourse/lib/foodsoft_discourse/redirect_to_login.rb index 901979b1..6ddfdb13 100644 --- a/plugins/discourse/lib/foodsoft_discourse/redirect_to_login.rb +++ b/plugins/discourse/lib/foodsoft_discourse/redirect_to_login.rb @@ -2,7 +2,7 @@ module FoodsoftDiscourse module RedirectToLogin def self.included(base) # :nodoc: base.class_eval do - alias foodsoft_discourse_orig_redirect_to_login redirect_to_login + alias_method :foodsoft_discourse_orig_redirect_to_login, :redirect_to_login def redirect_to_login(options = {}) if FoodsoftDiscourse.enabled? && !FoodsoftConfig[:discourse_sso] @@ -18,5 +18,5 @@ end # modify existing helper ActiveSupport.on_load(:after_initialize) do - Concerns::Auth.send :include, FoodsoftDiscourse::RedirectToLogin + Concerns::Auth.include FoodsoftDiscourse::RedirectToLogin end diff --git a/plugins/discourse/lib/foodsoft_discourse/version.rb b/plugins/discourse/lib/foodsoft_discourse/version.rb index 2b8d4138..60d38a51 100644 --- a/plugins/discourse/lib/foodsoft_discourse/version.rb +++ b/plugins/discourse/lib/foodsoft_discourse/version.rb @@ -1,3 +1,3 @@ module FoodsoftDiscourse - VERSION = "0.0.1" + VERSION = '0.0.1' end diff --git a/plugins/documents/Rakefile b/plugins/documents/Rakefile index 2834c5f3..861a530a 100755 --- a/plugins/documents/Rakefile +++ b/plugins/documents/Rakefile @@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__) load 'rails/tasks/engine.rake' Bundler::GemHelper.install_tasks @@ -34,4 +34,4 @@ Rake::TestTask.new(:test) do |t| t.verbose = false end -task :default => :test +task default: :test diff --git a/plugins/documents/app/controllers/documents_controller.rb b/plugins/documents/app/controllers/documents_controller.rb index b97470a5..8950f347 100644 --- a/plugins/documents/app/controllers/documents_controller.rb +++ b/plugins/documents/app/controllers/documents_controller.rb @@ -4,17 +4,17 @@ class DocumentsController < ApplicationController before_action -> { require_plugin_enabled FoodsoftDocuments } def index - if params["sort"] - sort = case params["sort"] - when "name" then "data IS NULL DESC, name" - when "created_at" then "created_at" - when "name_reverse" then "data IS NULL, name DESC" - when "created_at_reverse" then "created_at DESC" + sort = if params['sort'] + case params['sort'] + when 'name' then 'data IS NULL DESC, name' + when 'created_at' then 'created_at' + when 'name_reverse' then 'data IS NULL, name DESC' + when 'created_at_reverse' then 'created_at DESC' end - else - sort = "data IS NULL DESC, name" - end - + else + 'data IS NULL DESC, name' + end + sort = Arel.sql(sort) # this is okay as we don't use user params directly @documents = Document.where(parent: @document).page(params[:page]).per(@per_page).order(sort) end @@ -34,22 +34,22 @@ class DocumentsController < ApplicationController if @document.name.empty? name = File.basename(data.original_filename) - @document.name = name.gsub(/[^\w\.\-]/, '_') + @document.name = name.gsub(/[^\w.-]/, '_') end end @document.created_by = current_user @document.save! redirect_to @document.parent || documents_path, notice: t('.notice') - rescue => error - redirect_to @document.parent || documents_path, alert: t('.error', error: error.message) + rescue StandardError => e + redirect_to @document.parent || documents_path, alert: t('.error', error: e.message) end def update @document = Document.find(params[:id]) @document.update_attribute(:parent_id, params[:parent_id]) redirect_to @document.parent || documents_path, notice: t('.notice') - rescue => error - redirect_to @document.parent || documents_path, alert: t('errors.general_msg', msg: error.message) + rescue StandardError => e + redirect_to @document.parent || documents_path, alert: t('errors.general_msg', msg: e.message) end def destroy @@ -60,8 +60,8 @@ class DocumentsController < ApplicationController else redirect_to documents_path, alert: t('.no_right') end - rescue => error - redirect_to documents_path, alert: t('.error', error: error.message) + rescue StandardError => e + redirect_to documents_path, alert: t('.error', error: e.message) end def show diff --git a/plugins/documents/config/locales/de.yml b/plugins/documents/config/locales/de.yml index 39bbcb6f..be56700d 100644 --- a/plugins/documents/config/locales/de.yml +++ b/plugins/documents/config/locales/de.yml @@ -6,6 +6,7 @@ de: created_by: Erstellt von data: Daten mime: MIME-Typ + name: Name config: hints: documents_allowed_extension: Eine Liste an erlaubten Dateiendungen getrennt durch Leerzeichen. diff --git a/plugins/documents/config/locales/es.yml b/plugins/documents/config/locales/es.yml index fe092fdc..02103cc6 100644 --- a/plugins/documents/config/locales/es.yml +++ b/plugins/documents/config/locales/es.yml @@ -19,6 +19,7 @@ es: documents: create: error: 'El documento no puede ser creado: %{error}' + not_allowed_mime: El tipo de archivo "%{mime}" no está permitido. Póngase en contacto con un administrador/a para incluirlo en la lista blanca. notice: Se ha creado el documento destroy: error: 'El documento no puede ser borrado: %{error}' @@ -26,6 +27,14 @@ es: notice: Se ha borrado el documento form: new: Nuevo Documento + new_folder: Carpeta nueva + submit: Crear index: new: Sube nuevo documento + new_folder: Crear una nueva carpeta title: Documentos + move: + root_folder: Iniciar + title: Mover + update: + notice: Documento o carpeta fue movido diff --git a/plugins/documents/config/locales/tr.yml b/plugins/documents/config/locales/tr.yml new file mode 100644 index 00000000..05003fdf --- /dev/null +++ b/plugins/documents/config/locales/tr.yml @@ -0,0 +1,40 @@ +tr: + activerecord: + attributes: + document: + created_at: Oluşturulma tarihi + created_by: Tarafından oluşturuldu + data: Veri + mime: MIME türü + name: Ad + config: + hints: + documents_allowed_extension: İzin verilen dosya uzantılarının boşluklarla ayrılmış bir listesi. + use_documents: Gıda kooperatifi menüsüne temel bir belge paylaşım sayfası ekleyin. + keys: + documents_allowed_extension: İzin verilen uzantılar + use_documents: Belgeleri etkinleştir + navigation: + documents: Belgeler + documents: + create: + error: 'Belge veya klasör oluşturulamadı: %{error}' + not_allowed_mime: '"%{mime}" dosya türüne izin verilmiyor. Lütfen bunu beyaz listeye almak için bir yöneticiyle iletişime geçin.' + notice: Belge veya klasör oluşturuldu + destroy: + error: 'Belge veya klasör silinemedi: %{error}' + no_right: Belgeyi veya klasörü silmek için yeterli yetkiniz yok + notice: Belge veya klasör silindi + form: + new: Yeni belge + new_folder: Yeni klasör + submit: Oluştur + index: + new: Yeni belge yükle + new_folder: Yeni klasör oluştur + title: Belgeler + move: + root_folder: Başlangıç + title: Taşı + update: + notice: Belge veya klasör taşındı diff --git a/plugins/documents/foodsoft_documents.gemspec b/plugins/documents/foodsoft_documents.gemspec index 1301fa11..63d3b428 100644 --- a/plugins/documents/foodsoft_documents.gemspec +++ b/plugins/documents/foodsoft_documents.gemspec @@ -1,21 +1,22 @@ -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('lib', __dir__) # Maintain your gem's version: -require "foodsoft_documents/version" +require 'foodsoft_documents/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "foodsoft_documents" + s.name = 'foodsoft_documents' s.version = FoodsoftDocuments::VERSION - s.authors = ["paroga"] - s.email = ["paroga@paroga.com"] - s.homepage = "https://github.com/foodcoops/foodsoft" - s.summary = "Documents plugin for foodsoft." - s.description = "Adds simple document management to foodsoft." + s.authors = ['paroga'] + s.email = ['paroga@paroga.com'] + s.homepage = 'https://github.com/foodcoops/foodsoft' + s.summary = 'Documents plugin for foodsoft.' + s.description = 'Adds simple document management to foodsoft.' - s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"] + s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile', 'README.md'] - s.add_dependency "rails" - s.add_dependency "deface", "~> 1.0" - s.add_dependency "ruby-filemagic" + s.add_dependency 'rails' + s.add_dependency 'deface', '~> 1.0' + s.add_dependency 'ruby-filemagic' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/plugins/documents/lib/foodsoft_documents/engine.rb b/plugins/documents/lib/foodsoft_documents/engine.rb index 970b3aa5..de81904c 100644 --- a/plugins/documents/lib/foodsoft_documents/engine.rb +++ b/plugins/documents/lib/foodsoft_documents/engine.rb @@ -8,9 +8,9 @@ module FoodsoftDocuments sub_nav.items << SimpleNavigation::Item.new(primary, :documents, I18n.t('navigation.documents'), context.documents_path) # move to right before tasks item - if i = sub_nav.items.index(sub_nav[:tasks]) - sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) - end + return unless i = sub_nav.items.index(sub_nav[:tasks]) + + sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) end def default_foodsoft_config(cfg) diff --git a/plugins/documents/lib/foodsoft_documents/version.rb b/plugins/documents/lib/foodsoft_documents/version.rb index 6e57dbb3..7096e468 100644 --- a/plugins/documents/lib/foodsoft_documents/version.rb +++ b/plugins/documents/lib/foodsoft_documents/version.rb @@ -1,3 +1,3 @@ module FoodsoftDocuments - VERSION = "0.0.1" + VERSION = '0.0.1' end diff --git a/plugins/links/Rakefile b/plugins/links/Rakefile index fb6356f8..a9902fd3 100755 --- a/plugins/links/Rakefile +++ b/plugins/links/Rakefile @@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__) load 'rails/tasks/engine.rake' Bundler::GemHelper.install_tasks @@ -34,4 +34,4 @@ Rake::TestTask.new(:test) do |t| t.verbose = false end -task :default => :test +task default: :test diff --git a/plugins/links/app/controllers/admin/links_controller.rb b/plugins/links/app/controllers/admin/links_controller.rb index 2b6a7a35..dc8b359e 100644 --- a/plugins/links/app/controllers/admin/links_controller.rb +++ b/plugins/links/app/controllers/admin/links_controller.rb @@ -37,8 +37,8 @@ class Admin::LinksController < Admin::BaseController link = Link.find(params[:id]) link.destroy! redirect_to admin_links_path - rescue => error - redirect_to admin_links_path, I18n.t('errors.general_msg', msg: error.message) + rescue StandardError => e + redirect_to admin_links_path, I18n.t('errors.general_msg', msg: e.message) end private diff --git a/plugins/links/app/controllers/links_controller.rb b/plugins/links/app/controllers/links_controller.rb index 143fc63d..df38bee3 100644 --- a/plugins/links/app/controllers/links_controller.rb +++ b/plugins/links/app/controllers/links_controller.rb @@ -5,9 +5,7 @@ class LinksController < ApplicationController link = Link.find(params[:id]) url = link.url - if link.workgroup && !current_user.role_admin? && !link.workgroup.member?(current_user) - return deny_access - end + return deny_access if link.workgroup && !current_user.role_admin? && !link.workgroup.member?(current_user) if link.indirect uri = URI.parse url @@ -19,11 +17,9 @@ class LinksController < ApplicationController url = result.header['Location'] - unless url - return redirect_to root_url, alert: t('.indirect_no_location') - end + return redirect_to root_url, alert: t('.indirect_no_location') unless url end - redirect_to url, status: 302 + redirect_to url, status: :found, allow_other_host: true end end diff --git a/plugins/links/config/locales/tr.yml b/plugins/links/config/locales/tr.yml new file mode 100644 index 00000000..2de2dc20 --- /dev/null +++ b/plugins/links/config/locales/tr.yml @@ -0,0 +1,23 @@ +tr: + activerecord: + attributes: + link: + name: Adı + url: URL + workgroup: Çalışma Grubu + indirect: Dolaylı + authorization: Yetkilendirme Başlığı + admin: + links: + index: + title: Linkler + new_link: Yeni link ekle + form: + description: Bir çalışma grubu seçildiğinde, link yalnızca grubun üyelerine görünür. 'Dolaylı' seçeneği, Foodsoft'un kullanıcıları URL tarafından döndürülen adrese yönlendirmesine izin verir. Bu seçenek, yalnızca tam işlevselliği doğru anlaşıldığında etkinleştirilmelidir. + links: + show: + indirect_no_location: Yapılandırılmış URL, yönlendirme için bir Konum başlığı döndürmedi. + navigation: + admin: + links: Linkler + links: Linkler diff --git a/plugins/links/foodsoft_links.gemspec b/plugins/links/foodsoft_links.gemspec index e899c082..c879f4b1 100644 --- a/plugins/links/foodsoft_links.gemspec +++ b/plugins/links/foodsoft_links.gemspec @@ -1,20 +1,21 @@ -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('lib', __dir__) # Maintain your gem's version: -require "foodsoft_links/version" +require 'foodsoft_links/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "foodsoft_links" + s.name = 'foodsoft_links' s.version = FoodsoftLinks::VERSION - s.authors = ["paroga"] - s.email = ["paroga@paroga.com"] - s.homepage = "https://github.com/foodcoops/foodsoft" - s.summary = "Links plugin for foodsoft." - s.description = "Adds simple link management to foodsoft." + s.authors = ['paroga'] + s.email = ['paroga@paroga.com'] + s.homepage = 'https://github.com/foodcoops/foodsoft' + s.summary = 'Links plugin for foodsoft.' + s.description = 'Adds simple link management to foodsoft.' - s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"] + s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile', 'README.md'] - s.add_dependency "rails" - s.add_dependency "deface", "~> 1.0" + s.add_dependency 'rails' + s.add_dependency 'deface', '~> 1.0' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/plugins/links/lib/foodsoft_links/engine.rb b/plugins/links/lib/foodsoft_links/engine.rb index ab6d9175..52672597 100644 --- a/plugins/links/lib/foodsoft_links/engine.rb +++ b/plugins/links/lib/foodsoft_links/engine.rb @@ -1,7 +1,7 @@ module FoodsoftLinks class Engine < ::Rails::Engine def navigation(primary, context) - primary.item :links, I18n.t('navigation.links'), '#', if: Proc.new { visble_links(context).any? } do |subnav| + primary.item :links, I18n.t('navigation.links'), '#', if: proc { visble_links(context).any? } do |subnav| visble_links(context).each do |link| subnav.item link.id, link.name, context.link_path(link) end @@ -11,15 +11,15 @@ module FoodsoftLinks primary.items.insert(i, primary.items.delete_at(-1)) end - unless primary[:admin].nil? - sub_nav = primary[:admin].sub_navigation - sub_nav.items << - SimpleNavigation::Item.new(primary, :links, I18n.t('navigation.admin.links'), context.admin_links_path) - # move to right before config item - if i = sub_nav.items.index(sub_nav[:config]) - sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) - end - end + return if primary[:admin].nil? + + sub_nav = primary[:admin].sub_navigation + sub_nav.items << + SimpleNavigation::Item.new(primary, :links, I18n.t('navigation.admin.links'), context.admin_links_path) + # move to right before config item + return unless i = sub_nav.items.index(sub_nav[:config]) + + sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) end def visble_links(context) diff --git a/plugins/links/lib/foodsoft_links/version.rb b/plugins/links/lib/foodsoft_links/version.rb index 20341ca4..707cfdb3 100644 --- a/plugins/links/lib/foodsoft_links/version.rb +++ b/plugins/links/lib/foodsoft_links/version.rb @@ -1,3 +1,3 @@ module FoodsoftLinks - VERSION = "0.0.1" + VERSION = '0.0.1' end diff --git a/plugins/messages/Rakefile b/plugins/messages/Rakefile index ac014bdd..9e2cbeab 100755 --- a/plugins/messages/Rakefile +++ b/plugins/messages/Rakefile @@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__) load 'rails/tasks/engine.rake' Bundler::GemHelper.install_tasks @@ -34,4 +34,4 @@ Rake::TestTask.new(:test) do |t| t.verbose = false end -task :default => :test +task default: :test diff --git a/plugins/messages/app/controllers/admin/messagegroups_controller.rb b/plugins/messages/app/controllers/admin/messagegroups_controller.rb index cce57474..76fbbfb9 100644 --- a/plugins/messages/app/controllers/admin/messagegroups_controller.rb +++ b/plugins/messages/app/controllers/admin/messagegroups_controller.rb @@ -4,7 +4,7 @@ class Admin::MessagegroupsController < Admin::BaseController def index @messagegroups = Messagegroup.order('name ASC') # if somebody uses the search field: - @messagegroups = @messagegroups.where('name LIKE ?', "%#{params[:query]}%") unless params[:query].blank? + @messagegroups = @messagegroups.where('name LIKE ?', "%#{params[:query]}%") if params[:query].present? @messagegroups = @messagegroups.page(params[:page]).per(@per_page) end @@ -13,7 +13,7 @@ class Admin::MessagegroupsController < Admin::BaseController @messagegroup = Messagegroup.find(params[:id]) @messagegroup.destroy redirect_to admin_messagegroups_url, notice: t('admin.messagegroups.destroy.notice') - rescue => error - redirect_to admin_messagegroups_url, alert: t('admin.messagegroups.destroy.error', error: error.message) + rescue StandardError => e + redirect_to admin_messagegroups_url, alert: t('admin.messagegroups.destroy.error', error: e.message) end end diff --git a/plugins/messages/app/controllers/messagegroups_controller.rb b/plugins/messages/app/controllers/messagegroups_controller.rb index e9ba6770..7629eab8 100644 --- a/plugins/messages/app/controllers/messagegroups_controller.rb +++ b/plugins/messages/app/controllers/messagegroups_controller.rb @@ -1,17 +1,17 @@ class MessagegroupsController < ApplicationController def index - @messagegroups = Messagegroup.order("name") + @messagegroups = Messagegroup.order('name') end def join @messagegroup = Messagegroup.find(params[:id]) @messagegroup.users << current_user - redirect_to messagegroups_url, :notice => I18n.t('messagegroups.join.notice') + redirect_to messagegroups_url, notice: I18n.t('messagegroups.join.notice') end def leave @messagegroup = Messagegroup.find(params[:id]) @messagegroup.users.destroy(current_user) - redirect_to messagegroups_url, :notice => I18n.t('messagegroups.leave.notice') + redirect_to messagegroups_url, notice: I18n.t('messagegroups.leave.notice') end end diff --git a/plugins/messages/app/controllers/messages_controller.rb b/plugins/messages/app/controllers/messages_controller.rb index 159984ed..aadaad77 100644 --- a/plugins/messages/app/controllers/messages_controller.rb +++ b/plugins/messages/app/controllers/messages_controller.rb @@ -10,21 +10,21 @@ class MessagesController < ApplicationController def new @message = Message.new(params[:message]) - if @message.reply_to - original_message = Message.find(@message.reply_to) - if original_message.reply_to - @message.reply_to = original_message.reply_to - end - if original_message.is_readable_for?(current_user) - @message.add_recipients [original_message.sender_id] - @message.group_id = original_message.group_id - @message.private = original_message.private - @message.subject = I18n.t('messages.model.reply_subject', :subject => original_message.subject) - @message.body = I18n.t('messages.model.reply_header', :user => original_message.sender.display, :when => I18n.l(original_message.created_at, :format => :short)) + "\n" \ - + "" + original_message.body.to_trix_html + "" - else - redirect_to new_message_url, alert: I18n.t('messages.new.error_private') - end + return unless @message.reply_to + + original_message = Message.find(@message.reply_to) + @message.reply_to = original_message.reply_to if original_message.reply_to + if original_message.is_readable_for?(current_user) + @message.add_recipients [original_message.sender_id] + @message.group_id = original_message.group_id + @message.private = original_message.private + @message.subject = I18n.t('messages.model.reply_subject', subject: original_message.subject) + @message.body = I18n.t('messages.model.reply_header', user: original_message.sender.display, + when: I18n.l(original_message.created_at, format: :short)) + "\n" + @message.body = I18n.t('messages.model.reply_header', user: original_message.sender.display, when: I18n.l(original_message.created_at, format: :short)) + "\n" \ + + "
" + original_message.body.to_trix_html + "" + else + redirect_to new_message_url, alert: I18n.t('messages.new.error_private') end end @@ -33,18 +33,18 @@ class MessagesController < ApplicationController @message = @current_user.send_messages.new(params[:message]) if @message.save DeliverMessageJob.perform_later(@message) - redirect_to messages_url, :notice => I18n.t('messages.create.notice') + redirect_to messages_url, notice: I18n.t('messages.create.notice') else - render :action => 'new' + render action: 'new' end end # Shows a single message. def show @message = Message.find(params[:id]) - unless @message.is_readable_for?(current_user) - redirect_to messages_url, alert: I18n.t('messages.new.error_private') - end + return if @message.is_readable_for?(current_user) + + redirect_to messages_url, alert: I18n.t('messages.new.error_private') end def toggle_private diff --git a/plugins/messages/app/helpers/messages_helper.rb b/plugins/messages/app/helpers/messages_helper.rb index d386e6df..c385a17f 100644 --- a/plugins/messages/app/helpers/messages_helper.rb +++ b/plugins/messages/app/helpers/messages_helper.rb @@ -1,11 +1,11 @@ module MessagesHelper def format_subject(message, length) if message.subject.length > length - subject = truncate(message.subject, :length => length) - body = "" + subject = truncate(message.subject, length: length) + body = '' else subject = message.subject - body = truncate(message.body.to_plain_text, :length => length - subject.length) + body = truncate(message.body.to_plain_text, length: length - subject.length) end "#{link_to(h(subject), message)} #{h(body)}".html_safe end diff --git a/plugins/messages/app/mail_receivers/messages_mail_receiver.rb b/plugins/messages/app/mail_receivers/messages_mail_receiver.rb index e9ca99f3..006c3f8d 100644 --- a/plugins/messages/app/mail_receivers/messages_mail_receiver.rb +++ b/plugins/messages/app/mail_receivers/messages_mail_receiver.rb @@ -1,4 +1,4 @@ -require "email_reply_trimmer" +require 'email_reply_trimmer' class MessagesMailReceiver def self.regexp @@ -9,29 +9,25 @@ class MessagesMailReceiver @message = Message.find_by_id(match[:message_id]) @user = User.find_by_id(match[:user_id]) - raise "Message could not be found" if @message.nil? - raise "User could not be found" if @user.nil? + raise 'Message could not be found' if @message.nil? + raise 'User could not be found' if @user.nil? hash = @message.mail_hash_for_user(@user) - raise "Hash does not match expectations" unless hash.casecmp(match[:hash]) == 0 + raise 'Hash does not match expectations' unless hash.casecmp(match[:hash]) == 0 end def received(data) mail = Mail.new data mail_part = get_mail_part(mail) - raise "No valid content could be found" if mail_part.nil? + raise 'No valid content could be found' if mail_part.nil? body = mail_part.body.decoded - unless mail_part.content_type_parameters.nil? - body = body.force_encoding mail_part.content_type_parameters[:charset] - end + body = body.force_encoding mail_part.content_type_parameters[:charset] unless mail_part.content_type_parameters.nil? - if MIME::Type.simplified(mail_part.content_type) == "text/html" - body = Nokogiri::HTML(body).text - end + body = Nokogiri::HTML(body).text if MIME::Type.simplified(mail_part.content_type) == 'text/html' - body.encode!(Encoding::default_internal) + body.encode!(Encoding.default_internal) body = EmailReplyTrimmer.trim(body) raise BlankBodyException if body.empty? @@ -39,16 +35,16 @@ class MessagesMailReceiver group: @message.group, private: @message.private, received_email: data - if @message.reply_to - message.reply_to_message = @message.reply_to_message - else - message.reply_to_message = @message - end - if mail.subject - message.subject = mail.subject.gsub("[#{FoodsoftConfig[:name]}] ", "") - else - message.subject = I18n.t('messages.model.reply_subject', subject: message.reply_to_message.subject) - end + message.reply_to_message = if @message.reply_to + @message.reply_to_message + else + @message + end + message.subject = if mail.subject + mail.subject.gsub("[#{FoodsoftConfig[:name]}] ", '') + else + I18n.t('messages.model.reply_subject', subject: message.reply_to_message.subject) + end message.add_recipients [@message.sender_id] message.save! @@ -64,9 +60,7 @@ class MessagesMailReceiver for part in mail.parts part = get_mail_part(part) content_type = MIME::Type.simplified(part.content_type) - if content_type == "text/plain" || !mail_part && content_type == "text/html" - mail_part = part - end + mail_part = part if content_type == 'text/plain' || (!mail_part && content_type == 'text/html') end mail_part end diff --git a/plugins/messages/app/models/message.rb b/plugins/messages/app/models/message.rb index b5087d0d..0dd1db19 100644 --- a/plugins/messages/app/models/message.rb +++ b/plugins/messages/app/models/message.rb @@ -1,17 +1,17 @@ -require "base32" +require 'base32' class Message < ApplicationRecord - belongs_to :sender, class_name: 'User', foreign_key: 'sender_id' - belongs_to :group, optional: true, class_name: 'Group', foreign_key: 'group_id' + belongs_to :sender, class_name: 'User' + belongs_to :group, optional: true, class_name: 'Group' belongs_to :reply_to_message, optional: true, class_name: 'Message', foreign_key: 'reply_to' has_many :message_recipients, dependent: :destroy has_many :recipients, through: :message_recipients, source: :user attr_accessor :send_method, :recipient_tokens, :order_id - scope :threads, -> { where(:reply_to => nil) } - scope :thread, ->(id) { where("id = ? OR reply_to = ?", id, id) } - scope :readable_for, ->(user) { + scope :threads, -> { where(reply_to: nil) } + scope :thread, ->(id) { where('id = ? OR reply_to = ?', id, id) } + scope :readable_for, lambda { |user| user_id = user.try(&:id) joins(:message_recipients) @@ -20,7 +20,7 @@ class Message < ApplicationRecord } validates_presence_of :message_recipients, :subject, :body - validates_length_of :subject, :in => 1..255 + validates_length_of :subject, in: 1..255 has_rich_text :body @@ -35,7 +35,7 @@ class Message < ApplicationRecord def create_message_recipients user_ids = @recipients_ids user_ids += User.undeleted.pluck(:id) if send_method == 'all' - user_ids += Group.find(group_id).users.pluck(:id) unless group_id.blank? + user_ids += Group.find(group_id).users.pluck(:id) if group_id.present? user_ids += Order.find(order_id).users_ordered.pluck(:id) if send_method == 'order' user_ids.uniq.each do |user_id| @@ -49,7 +49,7 @@ class Message < ApplicationRecord end def group_id=(group_id) - group = Group.find(group_id) unless group_id.blank? + group = Group.find(group_id) if group_id.present? if group @send_method = 'workgroup' if group.type == 'Workgroup' @send_method = 'ordergroup' if group.type == 'Ordergroup' @@ -98,29 +98,29 @@ class Message < ApplicationRecord def mail_hash_for_user(user) digest = Digest::SHA1.new - digest.update self.id.to_s - digest.update ":" + digest.update id.to_s + digest.update ':' digest.update salt - digest.update ":" + digest.update ':' digest.update user.id.to_s Base32.encode digest.digest end # Returns true if this message is a system message, i.e. was sent automatically by Foodsoft itself. def system_message? - self.sender_id.nil? + sender_id.nil? end def sender_name - system_message? ? I18n.t('layouts.foodsoft') : sender.display rescue "?" + system_message? ? I18n.t('layouts.foodsoft') : sender.display + rescue StandardError + '?' end - def recipients_ids - @recipients_ids - end + attr_reader :recipients_ids def last_reply - Message.where(reply_to: self.id).order(:created_at).last + Message.where(reply_to: id).order(:created_at).last end def is_readable_for?(user) @@ -137,6 +137,6 @@ class Message < ApplicationRecord private def create_salt - self.salt = [Array.new(6) { rand(256).chr }.join].pack("m").chomp + self.salt = [Array.new(6) { rand(256).chr }.join].pack('m').chomp end end diff --git a/plugins/messages/app/models/message_recipient.rb b/plugins/messages/app/models/message_recipient.rb index e205ea5b..671b557d 100644 --- a/plugins/messages/app/models/message_recipient.rb +++ b/plugins/messages/app/models/message_recipient.rb @@ -2,5 +2,5 @@ class MessageRecipient < ActiveRecord::Base belongs_to :message belongs_to :user - enum email_state: [:pending, :sent, :skipped] + enum email_state: %i[pending sent skipped] end diff --git a/plugins/messages/app/models/messagegroup.rb b/plugins/messages/app/models/messagegroup.rb index 7c7f6c03..93666dd5 100644 --- a/plugins/messages/app/models/messagegroup.rb +++ b/plugins/messages/app/models/messagegroup.rb @@ -1,5 +1,3 @@ class Messagegroup < Group validates_uniqueness_of :name - - protected end diff --git a/plugins/messages/config/locales/de.yml b/plugins/messages/config/locales/de.yml index eb8cff21..2f423dc1 100644 --- a/plugins/messages/config/locales/de.yml +++ b/plugins/messages/config/locales/de.yml @@ -20,6 +20,7 @@ de: workgroup_id: Arbeitsgruppe messagegroup: description: Beschreibung + name: Name user_tokens: Mitglieder models: message: Nachricht @@ -84,6 +85,7 @@ de: model: reply_header: ! '%{user} schrieb am %{when}:' reply_indent: ! '> %{line}' + reply_subject: ! 'Re: %{subject}' new: error_private: Nachricht ist privat! hint_private: Nachricht erscheint nicht im Foodsoft Posteingang diff --git a/plugins/messages/config/locales/es.yml b/plugins/messages/config/locales/es.yml index 3b505e79..81a9a206 100644 --- a/plugins/messages/config/locales/es.yml +++ b/plugins/messages/config/locales/es.yml @@ -59,6 +59,7 @@ es: write_message: Escribir un mensaje messagegroups: index: + body: 'Un grupo de mensajes es como una lista de correo: puedes unirte (o salir) a cualquiera de ellos para recibir las actualizaciones enviadas a ese grupo.' title: Grupos de mensaje join: error: 'No pudo unirse al grupo de mensaje: %{error}' @@ -72,27 +73,38 @@ es: messages: actionbar: message_threads: Muestra como hilos + messagegroups: Suscribirse a este grupo messages: Muestra como lista new: Nuevo mensaje + create: + notice: El mensaje ha sido guardado y será enviado. index: title: Mensajes messages: reply: Responde + model: + reply_header: ! '%{user} escribió en %{when}:' + reply_indent: ! '> %{line}' + reply_subject: ! 'Re: %{subject}' new: error_private: Lo siento, este mensaje es privado. + hint_private: El mensaje no se muestra en el buzón de correo Foodsoft list: desc: ! 'Envía mensajes a todos los miembros a través de la lista de correo: %{list}' mail: por ejemplo con un email a %{email}. subscribe: Puedes leer más sobre la lista de correos en %{link}. subscribe_msg: Quizás tengas que suscribirte a la lista primero. + wiki: Wiki (lista de correo de páginas) message: mensaje no_user_found: No se ha encontrado el usuario + order_item: "%{supplier_name} (Recoger: %{pickup})" reply_to: Este mensaje es una respuesta a otro %{link}. search: Busca ... search_user: Busca usuario title: Nuevo mensaje show: all_messages: Todos los mensajes + change_visibility: 'Cambiar' from: ! 'De:' group: 'Grupo:' reply: Responde @@ -101,19 +113,35 @@ es: subject: ! 'Asunto:' title: Muestra mensaje to: 'A:' + visibility: 'Visibilidad:' + visibility_private: 'Privado' + visibility_public: 'Público' thread: all_message_threads: Todos los hilos de mensaje reply: Responde + toggle_private: + not_allowed: No puede cambiar la visibilidad del mensaje. message_threads: groupmessage_threads: show_message_threads: muestra todos index: + general: General title: Hilos de mensaje message_threads: last_reply_at: Última respuesta el - last_reply_by: Última respuesta de + last_reply_by: Última respuesta de started_at: Comenzado el started_by: Comenzado por + show: + general: General + messages_mailer: + foodsoft_message: + footer: | + Respuesta: %{reply_url} + Ver mensaje en línea: %{msg_url} + Opciones de mensaje: %{profile_url} + footer_group: | + Enviado al grupo: %{group} navigation: admin: messagegroups: Grupos de mensaje diff --git a/plugins/messages/config/locales/tr.yml b/plugins/messages/config/locales/tr.yml new file mode 100644 index 00000000..002d1c9b --- /dev/null +++ b/plugins/messages/config/locales/tr.yml @@ -0,0 +1,156 @@ +tr: + activerecord: + attributes: + message: + body: Mesaj İçeriği + messagegroup_id: Mesaj Grubu + order_id: Sipariş + ordergroup_id: Sipariş Grubu + private: Özel + recipient_tokens: (Ek) alıcılar + send_method: + all: Tüm üyelere gönder + recipients: Belirli üyelere gönder + order: Bir siparişe katılan üyelere gönder + ordergroup: Bir sipariş grubunun üyelerine gönder + messagegroup: Bir mesaj grubunun üyelerine gönder + workgroup: Bir iş grubunun üyelerine gönder + send_to_all: Tüm üyelere gönder + subject: Konu + workgroup_id: İş Grubu + messagegroup: + description: Açıklama + name: Ad + user_tokens: Üyeler + models: + message: Mesaj + messagegroup: Mesaj grubu + admin: + ordergroups: + show: + send_message: Mesaj gönder + users: + show: + send_message: Mesaj gönder + config: + hints: + mailing_list: Tüm üyelere için mesajlaşma sistemi yerine kullanılabilecek posta listesi e-posta adresi. + mailing_list_subscribe: Üyelerin abone olmak için bir e-posta gönderebileceği e-posta adresi. + use_messages: Üyelerin Foodsoft içinde birbirleriyle iletişim kurmasına izin ver. + keys: + use_messages: Mesajlar + mailing_list: Posta Listesi + mailing_list_subscribe: Posta Listesi Aboneliği + helpers: + messages: + write_message: Mesaj yaz + submit: + message: + create: Mesaj gönder + home: + index: + messages: + title: En yeni mesajlar + view_all: + text: '%{messages} veya %{threads} göster' + messages: tüm mesajlar + threads: konular + start_nav: + write_message: Mesaj yaz + messagegroups: + index: + body: 'Bir mesaj grubu, bir posta listesi gibi: o gruba üye olabilir (veya çıkabilir) ve o gruba gönderilen güncellemeleri alabilirsiniz.' + title: Mesaj grupları + join: + error: 'Mesaj grubuna katılamadı: %{error}' + notice: Mesaj grubuna katıldınız + leave: + error: 'Mesaj grubu terk edilemedi: %{error}' + notice: Mesaj grubundan ayrıldınız + messagegroup: + join: Mesaj grubuna katıl + leave: Mesaj grubundan ayrıl + messages: + actionbar: + message_threads: Konu olarak göster + messagegroups: Gruplara abone ol + messages: Liste olarak göster + new: Yeni mesaj + create: + notice: Mesaj kaydedildi ve gönderilecek. + index: + title: Mesajlar + messages: + reply: Yanıtla + model: + reply_header: ! '%{user} %{when} tarihinde yazdı:' + reply_indent: ! '> %{line}' + reply_subject: ! 'Yanıt: %{subject}' + new: + error_private: Üzgünüz, bu mesaj özel. + hint_private: Mesaj Foodsoft posta kutusunda gösterilmez. + list: + desc: ! 'Lütfen tüm mesajları şu mailing-liste gönderin: %{list}' + mail: örneğin %{email} adresine bir e-posta ile. + subscribe: 'E-posta listesi hakkında daha fazla bilgi edinebilirsiniz: %{link}.' + subscribe_msg: Önce e-posta listesine kaydolmanız gerekebilir. + wiki: Wiki (page Posta-listesi) + message: mesaj + no_user_found: Kullanıcı bulunamadı. + order_item: "%{supplier_name} (Pickup: %{pickup})" + reply_to: Bu mesaj, başka bir %{link} yanıtıdır. + search: Ara ... + search_user: Kullanıcı ara + title: Yeni mesaj + show: + all_messages: Tüm mesajlar + change_visibility: 'Değiştir' + from: ! 'Kimden:' + group: 'Grup:' + reply: Yanıtla + reply_to: 'Yanıtla:' + sent_on: ! 'Gönderildi:' + subject: ! 'Konu:' + title: Mesajı Göster + to: 'Kime:' + visibility: 'Görünürlük:' + visibility_private: 'Özel' + visibility_public: 'Genel' + thread: + all_message_threads: Tüm mesaj konuları + reply: Yanıtla + toggle_private: + not_allowed: Mesajın görünürlüğünü değiştiremezsiniz. + message_threads: + groupmessage_threads: + show_message_threads: tümünü göster + index: + general: Genel + title: Mesaj Konuları + message_threads: + last_reply_at: Son yanıt tarihi + last_reply_by: Son yanıtlayan + started_at: Başlangıç tarihi + started_by: Başlatan + show: + general: Genel + messages_mailer: + foodsoft_message: + footer: | + Yanıt: %{reply_url} + Mesajı çevrimiçi görüntüle: %{msg_url} + Mesajlaşma seçenekleri:: %{profile_url} + footer_group: | + Gruba gönderildi: %{group} + navigation: + admin: + messagegroups: Mesaj grupları + messages: Mesajlar + shared: + user_form_fields: + messagegroups: Mesaj gruplarına katıl veya ayrıl + simple_form: + labels: + settings: + messages: + send_as_email: Mesajları e-posta olarak al diff --git a/plugins/messages/config/routes.rb b/plugins/messages/config/routes.rb index d66eebdd..6d276428 100644 --- a/plugins/messages/config/routes.rb +++ b/plugins/messages/config/routes.rb @@ -1,13 +1,13 @@ Rails.application.routes.draw do scope '/:foodcoop' do - resources :messages, :only => [:index, :show, :new, :create] do + resources :messages, only: %i[index show new create] do member do get :thread post :toggle_private end end - resources :message_threads, :only => [:index, :show] + resources :message_threads, only: %i[index show] resources :messagegroups, only: [:index] do member do diff --git a/plugins/messages/db/migrate/20160226000000_add_email_to_message.rb b/plugins/messages/db/migrate/20160226000000_add_email_to_message.rb index 411600c7..034b023b 100644 --- a/plugins/messages/db/migrate/20160226000000_add_email_to_message.rb +++ b/plugins/messages/db/migrate/20160226000000_add_email_to_message.rb @@ -1,6 +1,6 @@ class AddEmailToMessage < ActiveRecord::Migration[4.2] def change add_column :messages, :salt, :string - add_column :messages, :received_email, :binary, :limit => 1.megabyte + add_column :messages, :received_email, :binary, limit: 1.megabyte end end diff --git a/plugins/messages/foodsoft_messages.gemspec b/plugins/messages/foodsoft_messages.gemspec index 0dfc7163..e7967191 100644 --- a/plugins/messages/foodsoft_messages.gemspec +++ b/plugins/messages/foodsoft_messages.gemspec @@ -1,25 +1,26 @@ -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('lib', __dir__) # Maintain your gem's version: -require "foodsoft_messages/version" +require 'foodsoft_messages/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "foodsoft_messages" + s.name = 'foodsoft_messages' s.version = FoodsoftMessages::VERSION - s.authors = ["robwa"] - s.email = ["foodsoft-messages@ini.tiative.net"] - s.homepage = "https://github.com/foodcoops/foodsoft" - s.summary = "Messaging plugin for foodsoft." - s.description = "Adds the ability to exchange messages to foodsoft." + s.authors = ['robwa'] + s.email = ['foodsoft-messages@ini.tiative.net'] + s.homepage = 'https://github.com/foodcoops/foodsoft' + s.summary = 'Messaging plugin for foodsoft.' + s.description = 'Adds the ability to exchange messages to foodsoft.' - s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"] + s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile', 'README.md'] - s.add_dependency "rails" - s.add_dependency "base32" - s.add_dependency "deface", "~> 1.0" - s.add_dependency "email_reply_trimmer" - s.add_dependency "mail" + s.add_dependency 'rails' + s.add_dependency 'base32' + s.add_dependency 'deface', '~> 1.0' + s.add_dependency 'email_reply_trimmer' + s.add_dependency 'mail' - s.add_development_dependency "sqlite3" + s.add_development_dependency 'sqlite3' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/plugins/messages/lib/foodsoft_messages.rb b/plugins/messages/lib/foodsoft_messages.rb index b457c8f1..9fc71928 100644 --- a/plugins/messages/lib/foodsoft_messages.rb +++ b/plugins/messages/lib/foodsoft_messages.rb @@ -1,7 +1,7 @@ -require "foodsoft_messages/engine" -require "foodsoft_messages/mail_receiver" -require "foodsoft_messages/user_link" -require "deface" +require 'foodsoft_messages/engine' +require 'foodsoft_messages/mail_receiver' +require 'foodsoft_messages/user_link' +require 'deface' module FoodsoftMessages # Return whether messages are used or not. diff --git a/plugins/messages/lib/foodsoft_messages/engine.rb b/plugins/messages/lib/foodsoft_messages/engine.rb index 0f67abb7..f054ada6 100644 --- a/plugins/messages/lib/foodsoft_messages/engine.rb +++ b/plugins/messages/lib/foodsoft_messages/engine.rb @@ -12,15 +12,16 @@ module FoodsoftMessages sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) end end - unless primary[:admin].nil? - sub_nav = primary[:admin].sub_navigation - sub_nav.items << - SimpleNavigation::Item.new(primary, :messagegroups, I18n.t('navigation.admin.messagegroups'), context.admin_messagegroups_path) - # move to right before config item - if i = sub_nav.items.index(sub_nav[:config]) - sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) - end - end + return if primary[:admin].nil? + + sub_nav = primary[:admin].sub_navigation + sub_nav.items << + SimpleNavigation::Item.new(primary, :messagegroups, I18n.t('navigation.admin.messagegroups'), + context.admin_messagegroups_path) + # move to right before config item + return unless i = sub_nav.items.index(sub_nav[:config]) + + sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) end def default_foodsoft_config(cfg) diff --git a/plugins/messages/lib/foodsoft_messages/user_link.rb b/plugins/messages/lib/foodsoft_messages/user_link.rb index bfab42b6..6fcf99c4 100644 --- a/plugins/messages/lib/foodsoft_messages/user_link.rb +++ b/plugins/messages/lib/foodsoft_messages/user_link.rb @@ -8,7 +8,7 @@ module FoodsoftMessages show_user user else link_to show_user(user), new_message_path('message[mail_to]' => user.id), - :title => I18n.t('helpers.messages.write_message') + title: I18n.t('helpers.messages.write_message') end end end @@ -18,5 +18,5 @@ end # modify existing helper ActiveSupport.on_load(:after_initialize) do - ApplicationHelper.send :include, FoodsoftMessages::UserLink + ApplicationHelper.include FoodsoftMessages::UserLink end diff --git a/plugins/messages/lib/foodsoft_messages/version.rb b/plugins/messages/lib/foodsoft_messages/version.rb index 2da75575..6209100d 100644 --- a/plugins/messages/lib/foodsoft_messages/version.rb +++ b/plugins/messages/lib/foodsoft_messages/version.rb @@ -1,3 +1,3 @@ module FoodsoftMessages - VERSION = "0.0.1" + VERSION = '0.0.1' end diff --git a/plugins/polls/Rakefile b/plugins/polls/Rakefile index 2834c5f3..861a530a 100755 --- a/plugins/polls/Rakefile +++ b/plugins/polls/Rakefile @@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__) load 'rails/tasks/engine.rake' Bundler::GemHelper.install_tasks @@ -34,4 +34,4 @@ Rake::TestTask.new(:test) do |t| t.verbose = false end -task :default => :test +task default: :test diff --git a/plugins/polls/app/controllers/polls_controller.rb b/plugins/polls/app/controllers/polls_controller.rb index b0c1a9eb..110c4d3f 100644 --- a/plugins/polls/app/controllers/polls_controller.rb +++ b/plugins/polls/app/controllers/polls_controller.rb @@ -27,9 +27,9 @@ class PollsController < ApplicationController def edit @poll = Poll.find(params[:id]) - if user_has_no_right - redirect_to polls_path, alert: t('.no_right') - end + return unless user_has_no_right + + redirect_to polls_path, alert: t('.no_right') end def update @@ -53,8 +53,8 @@ class PollsController < ApplicationController @poll.destroy redirect_to polls_path, notice: t('.notice') end - rescue => error - redirect_to polls_path, alert: t('.error', error: error.message) + rescue StandardError => e + redirect_to polls_path, alert: t('.error', error: e.message) end def vote @@ -73,25 +73,25 @@ class PollsController < ApplicationController @poll_vote = @poll.poll_votes.where(attributes).first_or_initialize - if request.post? - @poll_vote.update!(note: params[:note], user: current_user) + return unless request.post? - if @poll.single_select? - choices = {} - choice = params[:choice] - choices[choice] = '1' if choice - else - choices = params[:choices].try(:to_h) || {} - end + @poll_vote.update!(note: params[:note], user: current_user) - @poll_vote.poll_choices = choices.map do |choice, value| - poll_choice = @poll_vote.poll_choices.where(choice: choice).first_or_initialize - poll_choice.update!(value: value) - poll_choice - end - - redirect_to @poll + if @poll.single_select? + choices = {} + choice = params[:choice] + choices[choice] = '1' if choice + else + choices = params[:choices].try(:to_h) || {} end + + @poll_vote.poll_choices = choices.map do |choice, value| + poll_choice = @poll_vote.poll_choices.where(choice: choice).first_or_initialize + poll_choice.update!(value: value) + poll_choice + end + + redirect_to @poll end private diff --git a/plugins/polls/config/locales/tr.yml b/plugins/polls/config/locales/tr.yml new file mode 100644 index 00000000..ed2ea4c0 --- /dev/null +++ b/plugins/polls/config/locales/tr.yml @@ -0,0 +1,67 @@ +tr: +activerecord: + attributes: + poll: + choices: Seçenekler + created_at: Oluşturulma tarihi + created_by: Oluşturan + description: Açıklama + ends: Bitiş tarihi + name: Adı + max_points: Maksimum puan + min_points: Minimum puan + multi_select_count: Maksimum seçim sayısı + one_vote_per_ordergroup: Sadece bir oylama her sipariş grubu için + starts: Başlangıç tarihi + voting_method: Oylama yöntemi + voting_methods: + event: Etkinlik + single_select: Tek seçim + multi_select: Birden fazla seçim + points: Puanlar + resistance_points: Direniş puanları + poll_vote: + name: Adı + note: Not + updated_at: Son güncelleme + models: + poll: Oylama +config: + hints: + use_polls: Basit anketleri etkinleştirin. + keys: + use_polls: Anketleri etkinleştirin +navigation: + polls: Anketler +polls: + choice: + remove: Sil + create: + error: 'Anket oluşturulamadı: %{error}' + notice: Anket oluşturuldu + edit: + title: Anketi düzenle + form: + already_voted: Oylama yapıldığından seçenekler değiştirilemez. + new_choice: Yeni seçenek + required_ordergroup_custom_field: 'Sipariş grubunun ''%{label}'' alanı boş olamaz.' + required_user_custom_field: 'Kullanıcının ''%{label}'' alanı boş olamaz.' + destroy: + error: 'Anket silinemedi: %{error}' + no_right: Bu anketi silme izniniz yok + notice: Anket silindi + index: + new_poll: Yeni anket + title: Anketler + new: + title: Yeni anket + polls: + vote: Oyla + show: + vote: Oyla + update: + error: 'Anket güncellenemedi: %{error}' + notice: Anket güncellendi + vote: + submit: Oyla + no_right: Bu ankete katılamazsınız diff --git a/plugins/polls/db/migrate/20181110000000_create_polls.rb b/plugins/polls/db/migrate/20181110000000_create_polls.rb index 990e75f0..120b7eef 100644 --- a/plugins/polls/db/migrate/20181110000000_create_polls.rb +++ b/plugins/polls/db/migrate/20181110000000_create_polls.rb @@ -24,14 +24,14 @@ class CreatePolls < ActiveRecord::Migration[4.2] t.references :ordergroup t.text :note t.timestamps - t.index [:poll_id, :user_id, :ordergroup_id], unique: true + t.index %i[poll_id user_id ordergroup_id], unique: true end create_table :poll_choices do |t| t.references :poll_vote, null: false t.integer :choice, null: false t.integer :value, null: false - t.index [:poll_vote_id, :choice], unique: true + t.index %i[poll_vote_id choice], unique: true end end end diff --git a/plugins/polls/db/migrate/20181120000000_increase_choices_size.rb b/plugins/polls/db/migrate/20181120000000_increase_choices_size.rb index d809e3ea..621863dd 100644 --- a/plugins/polls/db/migrate/20181120000000_increase_choices_size.rb +++ b/plugins/polls/db/migrate/20181120000000_increase_choices_size.rb @@ -1,5 +1,5 @@ class IncreaseChoicesSize < ActiveRecord::Migration[4.2] def up - change_column :polls, :choices, :text, limit: 65535 + change_column :polls, :choices, :text, limit: 65_535 end end diff --git a/plugins/polls/foodsoft_polls.gemspec b/plugins/polls/foodsoft_polls.gemspec index 63e7db29..607a1276 100644 --- a/plugins/polls/foodsoft_polls.gemspec +++ b/plugins/polls/foodsoft_polls.gemspec @@ -1,20 +1,21 @@ -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('lib', __dir__) # Maintain your gem's version: -require "foodsoft_polls/version" +require 'foodsoft_polls/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "foodsoft_polls" + s.name = 'foodsoft_polls' s.version = FoodsoftPolls::VERSION - s.authors = ["paroga"] - s.email = ["paroga@paroga.com"] - s.homepage = "https://github.com/foodcoops/foodsoft" - s.summary = "Polls plugin for foodsoft." - s.description = "Adds possibility to do polls with foodsoft." + s.authors = ['paroga'] + s.email = ['paroga@paroga.com'] + s.homepage = 'https://github.com/foodcoops/foodsoft' + s.summary = 'Polls plugin for foodsoft.' + s.description = 'Adds possibility to do polls with foodsoft.' - s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"] + s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile', 'README.md'] - s.add_dependency "rails" - s.add_dependency "deface", "~> 1.0" + s.add_dependency 'rails' + s.add_dependency 'deface', '~> 1.0' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/plugins/polls/lib/foodsoft_polls/engine.rb b/plugins/polls/lib/foodsoft_polls/engine.rb index a76399f0..e4812345 100644 --- a/plugins/polls/lib/foodsoft_polls/engine.rb +++ b/plugins/polls/lib/foodsoft_polls/engine.rb @@ -8,9 +8,9 @@ module FoodsoftPolls sub_nav.items << SimpleNavigation::Item.new(primary, :polls, I18n.t('navigation.polls'), context.polls_path) # move to right before tasks item - if i = sub_nav.items.index(sub_nav[:tasks]) - sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) - end + return unless i = sub_nav.items.index(sub_nav[:tasks]) + + sub_nav.items.insert(i, sub_nav.items.delete_at(-1)) end end end diff --git a/plugins/polls/lib/foodsoft_polls/version.rb b/plugins/polls/lib/foodsoft_polls/version.rb index 5f3fb96d..84369283 100644 --- a/plugins/polls/lib/foodsoft_polls/version.rb +++ b/plugins/polls/lib/foodsoft_polls/version.rb @@ -1,3 +1,3 @@ module FoodsoftPolls - VERSION = "0.0.1" + VERSION = '0.0.1' end diff --git a/plugins/printer/Rakefile b/plugins/printer/Rakefile index 1c9d9839..fbf50e1d 100755 --- a/plugins/printer/Rakefile +++ b/plugins/printer/Rakefile @@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__) load 'rails/tasks/engine.rake' Bundler::GemHelper.install_tasks @@ -34,4 +34,4 @@ Rake::TestTask.new(:test) do |t| t.verbose = false end -task :default => :test +task default: :test diff --git a/plugins/printer/app/controllers/printer_controller.rb b/plugins/printer/app/controllers/printer_controller.rb index 178787da..78f13377 100644 --- a/plugins/printer/app/controllers/printer_controller.rb +++ b/plugins/printer/app/controllers/printer_controller.rb @@ -37,9 +37,7 @@ class PrinterController < ApplicationController job = PrinterJob.unfinished.find_by_id(json[:id]) return unless job - if json[:state] - job.add_update! json[:state], json[:message] - end + job.add_update! json[:state], json[:message] if json[:state] job.finish! if json[:finish] end diff --git a/plugins/printer/app/controllers/printer_jobs_controller.rb b/plugins/printer/app/controllers/printer_jobs_controller.rb index 37c864e9..4ba13803 100644 --- a/plugins/printer/app/controllers/printer_jobs_controller.rb +++ b/plugins/printer/app/controllers/printer_jobs_controller.rb @@ -15,7 +15,7 @@ class PrinterJobsController < ApplicationController state = order.open? ? 'queued' : 'ready' count = 0 PrinterJob.transaction do - %w(articles fax groups matrix).each do |document| + %w[articles fax groups matrix].each do |document| next unless FoodsoftConfig["printer_print_order_#{document}"] job = PrinterJob.create! order: order, document: document, created_by: current_user @@ -47,7 +47,7 @@ class PrinterJobsController < ApplicationController job = PrinterJob.find(params[:id]) job.finish! current_user redirect_to printer_jobs_path, notice: t('.notice') - rescue => error - redirect_to printer_jobs_path, t('errors.general_msg', msg: error.message) + rescue StandardError => e + redirect_to printer_jobs_path, t('errors.general_msg', msg: e.message) end end diff --git a/plugins/printer/config/locales/tr.yml b/plugins/printer/config/locales/tr.yml new file mode 100644 index 00000000..93346360 --- /dev/null +++ b/plugins/printer/config/locales/tr.yml @@ -0,0 +1,32 @@ +tr: + config: + keys: + printer_print_order_articles: Sipariş makbuzu PDF'lerini yazdır + printer_print_order_fax: Fax PDF'lerini yazdır + printer_print_order_groups: Grup PDF'lerini yazdır + printer_print_order_matrix: Matris PDF'lerini yazdır + printer_token: Gizli token + use_printer: Yazıcı kullan + helpers: + submit: + printer_job: + create: Yazıcı görevi oluştur + navigation: + orders: + printer_jobs: Yazıcı görevleri + orders: + show: + confirm_create_printer_job: Bu sipariş için bir yazıcı görevi zaten oluşturuldu. Yeni bir tane oluşturmak istiyor musunuz? + printer_jobs: + create: + notice: '%{count} yazıcı görevi oluşturuldu.' + destroy: + notice: Yazıcı görevi silindi. + index: + finished: Tamamlandı + pending: Beklemede + queued: Siparişin kapatılması bekleniyor + requeued: Yeniden sıraya konuldu + title: Yazıcı görevleri + show: + title: Yazıcı görevi %{id} diff --git a/plugins/printer/config/routes.rb b/plugins/printer/config/routes.rb index c81fc786..298ddfea 100644 --- a/plugins/printer/config/routes.rb +++ b/plugins/printer/config/routes.rb @@ -4,7 +4,7 @@ Rails.application.routes.draw do get :socket, on: :collection end - resources :printer_jobs, only: [:index, :create, :show, :destroy] do + resources :printer_jobs, only: %i[index create show destroy] do post :requeue, on: :member get :document, on: :member end diff --git a/plugins/printer/db/migrate/20181201000000_create_printer_jobs.rb b/plugins/printer/db/migrate/20181201000000_create_printer_jobs.rb index ee7665e4..36d175c5 100644 --- a/plugins/printer/db/migrate/20181201000000_create_printer_jobs.rb +++ b/plugins/printer/db/migrate/20181201000000_create_printer_jobs.rb @@ -15,6 +15,6 @@ class CreatePrinterJobs < ActiveRecord::Migration[4.2] t.text :message end - add_index :printer_job_updates, [:printer_job_id, :created_at] + add_index :printer_job_updates, %i[printer_job_id created_at] end end diff --git a/plugins/printer/foodsoft_printer.gemspec b/plugins/printer/foodsoft_printer.gemspec index d0eea89a..a6e54455 100644 --- a/plugins/printer/foodsoft_printer.gemspec +++ b/plugins/printer/foodsoft_printer.gemspec @@ -1,21 +1,22 @@ -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('lib', __dir__) # Maintain your gem's version: -require "foodsoft_printer/version" +require 'foodsoft_printer/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "foodsoft_printer" + s.name = 'foodsoft_printer' s.version = FoodsoftPrinter::VERSION - s.authors = ["paroga"] - s.email = ["paroga@paroga.com"] - s.homepage = "https://github.com/foodcoops/foodsoft" - s.summary = "Printer plugin for foodsoft." - s.description = "Add a printer queue to foodsoft." + s.authors = ['paroga'] + s.email = ['paroga@paroga.com'] + s.homepage = 'https://github.com/foodcoops/foodsoft' + s.summary = 'Printer plugin for foodsoft.' + s.description = 'Add a printer queue to foodsoft.' - s.files = Dir["{app,config,db,lib}/**/*"] + ["Rakefile", "README.md"] + s.files = Dir['{app,config,db,lib}/**/*'] + ['Rakefile', 'README.md'] - s.add_dependency "rails" - s.add_dependency "deface", "~> 1.0" - s.add_dependency "tubesock" + s.add_dependency 'rails' + s.add_dependency 'deface', '~> 1.0' + s.add_dependency 'tubesock' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/plugins/printer/lib/foodsoft_printer/engine.rb b/plugins/printer/lib/foodsoft_printer/engine.rb index 22144e30..8f1f00cc 100644 --- a/plugins/printer/lib/foodsoft_printer/engine.rb +++ b/plugins/printer/lib/foodsoft_printer/engine.rb @@ -3,18 +3,19 @@ module FoodsoftPrinter def navigation(primary, context) return unless FoodsoftPrinter.enabled? - unless primary[:orders].nil? - sub_nav = primary[:orders].sub_navigation - sub_nav.items << - SimpleNavigation::Item.new(primary, :printer_jobs, I18n.t('navigation.orders.printer_jobs'), context.printer_jobs_path) - end + return if primary[:orders].nil? + + sub_nav = primary[:orders].sub_navigation + sub_nav.items << + SimpleNavigation::Item.new(primary, :printer_jobs, I18n.t('navigation.orders.printer_jobs'), + context.printer_jobs_path) end def default_foodsoft_config(cfg) cfg[:use_printer] = false end - initializer 'foodsoft_printer.order_printer_jobs' do |app| + initializer 'foodsoft_printer.order_printer_jobs' do |_app| if Rails.configuration.cache_classes OrderPrinterJobs.install else diff --git a/plugins/printer/lib/foodsoft_printer/order_printer_jobs.rb b/plugins/printer/lib/foodsoft_printer/order_printer_jobs.rb index 7501a69e..4c7eeeaa 100644 --- a/plugins/printer/lib/foodsoft_printer/order_printer_jobs.rb +++ b/plugins/printer/lib/foodsoft_printer/order_printer_jobs.rb @@ -4,14 +4,14 @@ module FoodsoftPrinter base.class_eval do has_many :printer_jobs, dependent: :destroy - alias foodsoft_printer_orig_finish! finish! + alias_method :foodsoft_printer_orig_finish!, :finish! def finish!(user) foodsoft_printer_orig_finish!(user) - unless finished? - printer_jobs.unfinished.each do |job| - job.add_update! 'ready' - end + return if finished? + + printer_jobs.unfinished.each do |job| + job.add_update! 'ready' end end end diff --git a/plugins/printer/lib/foodsoft_printer/version.rb b/plugins/printer/lib/foodsoft_printer/version.rb index 17bd39cb..e9d2ad84 100644 --- a/plugins/printer/lib/foodsoft_printer/version.rb +++ b/plugins/printer/lib/foodsoft_printer/version.rb @@ -1,3 +1,3 @@ module FoodsoftPrinter - VERSION = "0.0.1" + VERSION = '0.0.1' end diff --git a/plugins/uservoice/foodsoft_uservoice.gemspec b/plugins/uservoice/foodsoft_uservoice.gemspec index f33760fb..4defe395 100644 --- a/plugins/uservoice/foodsoft_uservoice.gemspec +++ b/plugins/uservoice/foodsoft_uservoice.gemspec @@ -1,20 +1,21 @@ -$:.push File.expand_path("../lib", __FILE__) +$:.push File.expand_path('lib', __dir__) # Maintain your gem's version: -require "foodsoft_uservoice/version" +require 'foodsoft_uservoice/version' # Describe your gem and declare its dependencies: Gem::Specification.new do |s| - s.name = "foodsoft_uservoice" + s.name = 'foodsoft_uservoice' s.version = FoodsoftUservoice::VERSION - s.authors = ["wvengen"] - s.email = ["dev-foodsoft@willem.engen.nl"] - s.homepage = "https://github.com/foodcoops/foodsoft" - s.summary = "Uservoice plugin for foodsoft." - s.description = "Adds a uservoice feedback button to foodsoft." + s.authors = ['wvengen'] + s.email = ['dev-foodsoft@willem.engen.nl'] + s.homepage = 'https://github.com/foodcoops/foodsoft' + s.summary = 'Uservoice plugin for foodsoft.' + s.description = 'Adds a uservoice feedback button to foodsoft.' - s.files = Dir["{app,config,db,lib}/**/*"] + ["README.md"] + s.files = Dir['{app,config,db,lib}/**/*'] + ['README.md'] - s.add_dependency "rails" - s.add_dependency "content_for_in_controllers" + s.add_dependency 'rails' + s.add_dependency 'content_for_in_controllers' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/plugins/uservoice/lib/foodsoft_uservoice.rb b/plugins/uservoice/lib/foodsoft_uservoice.rb index b4718445..2d5b764b 100644 --- a/plugins/uservoice/lib/foodsoft_uservoice.rb +++ b/plugins/uservoice/lib/foodsoft_uservoice.rb @@ -1,5 +1,5 @@ -require "content_for_in_controllers" -require "foodsoft_uservoice/engine" +require 'content_for_in_controllers' +require 'foodsoft_uservoice/engine' module FoodsoftUservoice # enabled when configured, but can still be disabled by use_uservoice option @@ -19,11 +19,11 @@ module FoodsoftUservoice # include uservoice javascript api_key = FoodsoftConfig[:uservoice]['api_key'] - js_pre = "UserVoice=window.UserVoice||[];" + js_pre = 'UserVoice=window.UserVoice||[];' js_load = "var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/#{view_context.j api_key}.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s);" # configuration - sections = FoodsoftConfig[:uservoice].reject { |k, v| k == 'api_key' } + sections = FoodsoftConfig[:uservoice].except('api_key') sections.each_pair do |k, v| if k == 'identify' v['id'] = current_user.try(:id) if v.include?('id') @@ -48,5 +48,5 @@ module FoodsoftUservoice end ActiveSupport.on_load(:after_initialize) do - ApplicationController.send :include, FoodsoftUservoice::LoadUservoice + ApplicationController.include FoodsoftUservoice::LoadUservoice end diff --git a/plugins/uservoice/lib/foodsoft_uservoice/version.rb b/plugins/uservoice/lib/foodsoft_uservoice/version.rb index 8d78e3de..e806ff1d 100644 --- a/plugins/uservoice/lib/foodsoft_uservoice/version.rb +++ b/plugins/uservoice/lib/foodsoft_uservoice/version.rb @@ -1,3 +1,3 @@ module FoodsoftUservoice - VERSION = "0.0.1" + VERSION = '0.0.1' end diff --git a/plugins/wiki/Rakefile b/plugins/wiki/Rakefile index 5d2e31db..dd14bed8 100755 --- a/plugins/wiki/Rakefile +++ b/plugins/wiki/Rakefile @@ -20,7 +20,7 @@ RDoc::Task.new(:rdoc) do |rdoc| rdoc.rdoc_files.include('lib/**/*.rb') end -APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__) +APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__) load 'rails/tasks/engine.rake' Bundler::GemHelper.install_tasks @@ -34,4 +34,4 @@ Rake::TestTask.new(:test) do |t| t.verbose = false end -task :default => :test +task default: :test diff --git a/plugins/wiki/app/controllers/pages_controller.rb b/plugins/wiki/app/controllers/pages_controller.rb index c065abe7..0e28e2d5 100644 --- a/plugins/wiki/app/controllers/pages_controller.rb +++ b/plugins/wiki/app/controllers/pages_controller.rb @@ -1,20 +1,20 @@ class PagesController < ApplicationController before_action -> { require_plugin_enabled FoodsoftWiki } - before_action :catch_special_pages, only: [:show, :new] + before_action :catch_special_pages, only: %i[show new] - skip_before_action :authenticate, :only => :all - before_action :only => :all do - authenticate_or_token(['wiki', 'all']) + skip_before_action :authenticate, only: :all + before_action only: :all do + authenticate_or_token(%w[wiki all]) end before_action do content_for :head, view_context.rss_meta_tag end def index - @page = Page.find_by_permalink "Home" + @page = Page.find_by_permalink 'Home' if @page - render :action => 'show' + render action: 'show' else redirect_to all_pages_path end @@ -34,11 +34,11 @@ class PagesController < ApplicationController end if @page.nil? - redirect_to new_page_path(:title => params[:permalink]) + redirect_to new_page_path(title: params[:permalink]) elsif @page.redirect? page = Page.find_by_id(@page.redirect) unless page.nil? - flash[:notice] = I18n.t('pages.cshow.redirect_notice', :page => @page.title) + flash[:notice] = I18n.t('pages.cshow.redirect_notice', page: @page.title) redirect_to wiki_page_path(page.permalink) end end @@ -46,12 +46,12 @@ class PagesController < ApplicationController def new @page = Page.new - @page.title = params[:title].gsub("_", " ") if params[:title] + @page.title = params[:title].gsub('_', ' ') if params[:title] @page.parent = Page.find_by_permalink(params[:parent]) if params[:parent] respond_to do |format| format.html # new.html.erb - format.xml { render :xml => @page } + format.xml { render xml: @page } end end @@ -60,36 +60,32 @@ class PagesController < ApplicationController end def create - @page = Page.new(params[:page].merge({ :user => current_user })) + @page = Page.new(params[:page].merge({ user: current_user })) if params[:preview] - render :action => 'new' + render action: 'new' + elsif @page.save + flash[:notice] = I18n.t('pages.create.notice') + redirect_to(wiki_page_path(@page.permalink)) else - if @page.save - flash[:notice] = I18n.t('pages.create.notice') - redirect_to(wiki_page_path(@page.permalink)) - else - render :action => "new" - end + render action: 'new' end end def update @page = Page.find(params[:id]) - @page.attributes = params[:page].merge({ :user => current_user }) + @page.attributes = params[:page].merge({ user: current_user }) if params[:preview] @page.attributes = params[:page] - render :action => 'edit' + render action: 'edit' + elsif @page.save + @page.parent_id = parent_id if params[:parent_id].present? \ + && params[:parent_id] != @page_id + flash[:notice] = I18n.t('pages.update.notice') + redirect_to wiki_page_path(@page.permalink) else - if @page.save - @page.parent_id = parent_id if (!params[:parent_id].blank? \ - && params[:parent_id] != @page_id) - flash[:notice] = I18n.t('pages.update.notice') - redirect_to wiki_page_path(@page.permalink) - else - render :action => "edit" - end + render action: 'edit' end rescue ActiveRecord::StaleObjectError flash[:error] = I18n.t('pages.error_stale_object') @@ -100,7 +96,7 @@ class PagesController < ApplicationController @page = Page.find(params[:id]) @page.destroy - flash[:notice] = I18n.t('pages.destroy.notice', :page => @page.title) + flash[:notice] = I18n.t('pages.destroy.notice', page: @page.title) redirect_to wiki_path end @@ -109,23 +105,23 @@ class PagesController < ApplicationController @partial = params[:view] || 'site_map' if params[:name] - @pages = @pages.where("title LIKE ?", "%#{params[:name]}%").limit(20) + @pages = @pages.where('title LIKE ?', "%#{params[:name]}%").limit(20) @partial = 'title_list' end - if params[:sort] - sort = case params[:sort] - when "title" then "title" - when "title_reverse" then "title DESC" - when "last_updated" then "updated_at DESC" - when "last_updated_reverse" then "updated_at" + sort = if params[:sort] + case params[:sort] + when 'title' then 'title' + when 'title_reverse' then 'title DESC' + when 'last_updated' then 'updated_at DESC' + when 'last_updated_reverse' then 'updated_at' end - else - sort = "title" - end + else + 'title' + end @pages = @pages.order(sort) respond_to do |format| format.html - format.rss { render :layout => false } + format.rss { render layout: false } end end @@ -150,15 +146,15 @@ class PagesController < ApplicationController def variables keys = Foodsoft::ExpansionVariables.variables.keys - @variables = Hash[keys.map { |k| [k, Foodsoft::ExpansionVariables.get(k)] }] + @variables = keys.index_with { |k| Foodsoft::ExpansionVariables.get(k) } render 'variables' end private def catch_special_pages - if params[:id] == 'Help:Foodsoft_variables' - variables - end + return unless params[:id] == 'Help:Foodsoft_variables' + + variables end end diff --git a/plugins/wiki/app/helpers/pages_helper.rb b/plugins/wiki/app/helpers/pages_helper.rb index 2c1479f3..869f59d1 100644 --- a/plugins/wiki/app/helpers/pages_helper.rb +++ b/plugins/wiki/app/helpers/pages_helper.rb @@ -2,70 +2,70 @@ module PagesHelper include WikiCloth def rss_meta_tag - tag.link(rel: "alternate", type: "application/rss+xml", title: "RSS", href: all_pages_rss_url).html_safe + tag.link(rel: 'alternate', type: 'application/rss+xml', title: 'RSS', href: all_pages_rss_url).html_safe end def wikified_body(body, title = nil) FoodsoftWiki::WikiParser.new(data: body + "\n", params: { referer: title }).to_html(noedit: true).html_safe - rescue => e + rescue StandardError => e # try the following with line breaks: === one === == two == = three = content_tag :span, class: 'alert alert-error' do - I18n.t '.wikicloth_exception', :msg => e + I18n.t '.wikicloth_exception', msg: e end.html_safe end def link_to_wikipage(page, text = nil) - if text == nil - link_to page.title, wiki_page_path(:permalink => page.permalink) + if text.nil? + link_to page.title, wiki_page_path(permalink: page.permalink) else - link_to text, wiki_page_path(:permalink => page.permalink) + link_to text, wiki_page_path(permalink: page.permalink) end end def link_to_wikipage_by_permalink(permalink, text = nil) - unless permalink.blank? - page = Page.find_by_permalink(permalink) - if page.nil? - if text.nil? - link_to permalink, new_page_path(:title => permalink) - else - link_to text, new_page_path(:title => permalink) - end + return if permalink.blank? + + page = Page.find_by_permalink(permalink) + if page.nil? + if text.nil? + link_to permalink, new_page_path(title: permalink) else - link_to_wikipage(page, text) + link_to text, new_page_path(title: permalink) end + else + link_to_wikipage(page, text) end end def generate_toc(body) toc = String.new - body.gsub(/^([=]{1,6})\s*(.*?)\s*(\1)/) do - number = $1.length - 1 - name = $2 + body.gsub(/^(={1,6})\s*(.*?)\s*(\1)/) do + number = ::Regexp.last_match(1).length - 1 + name = ::Regexp.last_match(2) - toc << "*" * number + " #{name}\n" + toc << (('*' * number) + " #{name}\n") end - unless toc.blank? - FoodsoftWiki::WikiParser.new(data: toc).to_html.gsub(/