fix deposit is agnostic to percentage on pdf
This commit is contained in:
parent
3dc806317e
commit
91df920119
6 changed files with 260 additions and 69 deletions
106
db/schema.rb
106
db/schema.rb
|
|
@ -11,7 +11,7 @@
|
|||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
||||
create_table "action_text_rich_texts", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "action_text_rich_texts", charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.text "body", size: :long
|
||||
t.string "record_type", null: false
|
||||
|
|
@ -21,7 +21,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["record_type", "record_id", "name"], name: "index_action_text_rich_texts_uniqueness", unique: true
|
||||
end
|
||||
|
||||
create_table "active_storage_attachments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "active_storage_attachments", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "record_type", null: false
|
||||
t.bigint "record_id", null: false
|
||||
|
|
@ -31,7 +31,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
|
||||
end
|
||||
|
||||
create_table "active_storage_blobs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "active_storage_blobs", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "key", null: false
|
||||
t.string "filename", null: false
|
||||
t.string "content_type"
|
||||
|
|
@ -43,19 +43,19 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
|
||||
end
|
||||
|
||||
create_table "active_storage_variant_records", charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "active_storage_variant_records", charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "blob_id", null: false
|
||||
t.string "variation_digest", null: false
|
||||
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
|
||||
end
|
||||
|
||||
create_table "article_categories", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "article_categories", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", default: "", null: false
|
||||
t.string "description"
|
||||
t.index ["name"], name: "index_article_categories_on_name", unique: true
|
||||
end
|
||||
|
||||
create_table "article_prices", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "article_prices", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "article_id", 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
|
||||
|
|
@ -65,7 +65,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["article_id"], name: "index_article_prices_on_article_id"
|
||||
end
|
||||
|
||||
create_table "articles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "articles", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", default: "", null: false
|
||||
t.integer "supplier_id", default: 0, null: false
|
||||
t.integer "article_category_id", default: 0, null: false
|
||||
|
|
@ -91,14 +91,14 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["type"], name: "index_articles_on_type"
|
||||
end
|
||||
|
||||
create_table "assignments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "assignments", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "user_id", default: 0, null: false
|
||||
t.integer "task_id", default: 0, null: false
|
||||
t.boolean "accepted", default: false
|
||||
t.index ["user_id", "task_id"], name: "index_assignments_on_user_id_and_task_id", unique: true
|
||||
end
|
||||
|
||||
create_table "bank_accounts", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "bank_accounts", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "iban"
|
||||
t.string "description"
|
||||
|
|
@ -108,14 +108,14 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.integer "bank_gateway_id"
|
||||
end
|
||||
|
||||
create_table "bank_gateways", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "bank_gateways", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "url", null: false
|
||||
t.string "authorization"
|
||||
t.integer "unattended_user_id"
|
||||
end
|
||||
|
||||
create_table "bank_transactions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "bank_transactions", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "bank_account_id", null: false
|
||||
t.string "external_id"
|
||||
t.date "date"
|
||||
|
|
@ -129,7 +129,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["financial_link_id"], name: "index_bank_transactions_on_financial_link_id"
|
||||
end
|
||||
|
||||
create_table "documents", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "documents", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "mime"
|
||||
t.binary "data", size: :long
|
||||
|
|
@ -140,16 +140,16 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["parent_id"], name: "index_documents_on_parent_id"
|
||||
end
|
||||
|
||||
create_table "financial_links", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "financial_links", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.text "note"
|
||||
end
|
||||
|
||||
create_table "financial_transaction_classes", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "financial_transaction_classes", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.boolean "ignore_for_account_balance", default: false, null: false
|
||||
end
|
||||
|
||||
create_table "financial_transaction_types", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "financial_transaction_types", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.integer "financial_transaction_class_id", null: false
|
||||
t.string "name_short"
|
||||
|
|
@ -157,7 +157,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["name_short"], name: "index_financial_transaction_types_on_name_short"
|
||||
end
|
||||
|
||||
create_table "financial_transactions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "financial_transactions", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "ordergroup_id"
|
||||
t.decimal "amount", precision: 8, scale: 2, default: "0.0", null: false
|
||||
t.text "note", null: false
|
||||
|
|
@ -171,7 +171,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["reverts_id"], name: "index_financial_transactions_on_reverts_id", unique: true
|
||||
end
|
||||
|
||||
create_table "group_order_article_quantities", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "group_order_article_quantities", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "group_order_article_id", default: 0, null: false
|
||||
t.integer "quantity", default: 0
|
||||
t.integer "tolerance", default: 0
|
||||
|
|
@ -179,7 +179,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["group_order_article_id"], name: "index_group_order_article_quantities_on_group_order_article_id"
|
||||
end
|
||||
|
||||
create_table "group_order_articles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "group_order_articles", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "group_order_id", default: 0, null: false
|
||||
t.integer "order_article_id", default: 0, null: false
|
||||
t.integer "quantity", default: 0, null: false
|
||||
|
|
@ -192,7 +192,17 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["order_article_id"], name: "index_group_order_articles_on_order_article_id"
|
||||
end
|
||||
|
||||
create_table "group_orders", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "group_order_invoices", charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "group_order_id"
|
||||
t.bigint "invoice_number"
|
||||
t.date "invoice_date"
|
||||
t.string "payment_method"
|
||||
t.datetime "created_at", precision: nil, null: false
|
||||
t.datetime "updated_at", precision: nil, null: false
|
||||
t.index ["group_order_id"], name: "index_group_order_invoices_on_group_order_id", unique: true
|
||||
end
|
||||
|
||||
create_table "group_orders", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "ordergroup_id"
|
||||
t.integer "order_id", default: 0, null: false
|
||||
t.decimal "price", precision: 8, scale: 2, default: "0.0", null: false
|
||||
|
|
@ -205,7 +215,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["ordergroup_id"], name: "index_group_orders_on_ordergroup_id"
|
||||
end
|
||||
|
||||
create_table "groups", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "groups", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "type", default: "", null: false
|
||||
t.string "name", default: "", null: false
|
||||
t.string "description"
|
||||
|
|
@ -231,7 +241,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["name"], name: "index_groups_on_name", unique: true
|
||||
end
|
||||
|
||||
create_table "invites", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "invites", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "token", default: "", null: false
|
||||
t.datetime "expires_at", precision: nil, null: false
|
||||
t.integer "group_id", default: 0, null: false
|
||||
|
|
@ -240,7 +250,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["token"], name: "index_invites_on_token"
|
||||
end
|
||||
|
||||
create_table "invoices", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "invoices", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "supplier_id"
|
||||
t.string "number"
|
||||
t.date "date"
|
||||
|
|
@ -258,7 +268,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["supplier_id"], name: "index_invoices_on_supplier_id"
|
||||
end
|
||||
|
||||
create_table "links", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "links", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "url", null: false
|
||||
t.integer "workgroup_id"
|
||||
|
|
@ -266,7 +276,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.string "authorization"
|
||||
end
|
||||
|
||||
create_table "mail_delivery_status", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "mail_delivery_status", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.datetime "created_at", precision: nil
|
||||
t.string "email", null: false
|
||||
t.string "message", null: false
|
||||
|
|
@ -275,13 +285,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["email"], name: "index_mail_delivery_status_on_email"
|
||||
end
|
||||
|
||||
create_table "memberships", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "memberships", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "group_id", default: 0, null: false
|
||||
t.integer "user_id", default: 0, null: false
|
||||
t.index ["user_id", "group_id"], name: "index_memberships_on_user_id_and_group_id", unique: true
|
||||
end
|
||||
|
||||
create_table "message_recipients", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "message_recipients", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "message_id", null: false
|
||||
t.integer "user_id", null: false
|
||||
t.integer "email_state", default: 0, null: false
|
||||
|
|
@ -290,7 +300,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["user_id", "read_at"], name: "index_message_recipients_on_user_id_and_read_at"
|
||||
end
|
||||
|
||||
create_table "messages", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "messages", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "sender_id"
|
||||
t.string "subject", null: false
|
||||
t.boolean "private", default: false
|
||||
|
|
@ -301,7 +311,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.binary "received_email", size: :medium
|
||||
end
|
||||
|
||||
create_table "oauth_access_grants", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "oauth_access_grants", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "resource_owner_id", null: false
|
||||
t.integer "application_id", null: false
|
||||
t.string "token", null: false
|
||||
|
|
@ -313,7 +323,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["token"], name: "index_oauth_access_grants_on_token", unique: true
|
||||
end
|
||||
|
||||
create_table "oauth_access_tokens", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "oauth_access_tokens", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "resource_owner_id"
|
||||
t.integer "application_id"
|
||||
t.string "token", null: false
|
||||
|
|
@ -327,7 +337,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["token"], name: "index_oauth_access_tokens_on_token", unique: true
|
||||
end
|
||||
|
||||
create_table "oauth_applications", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "oauth_applications", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "uid", null: false
|
||||
t.string "secret", null: false
|
||||
|
|
@ -339,7 +349,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["uid"], name: "index_oauth_applications_on_uid", unique: true
|
||||
end
|
||||
|
||||
create_table "order_articles", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "order_articles", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "order_id", default: 0, null: false
|
||||
t.integer "article_id", default: 0, null: false
|
||||
t.integer "quantity", default: 0, null: false
|
||||
|
|
@ -353,7 +363,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["order_id"], name: "index_order_articles_on_order_id"
|
||||
end
|
||||
|
||||
create_table "order_comments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "order_comments", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "order_id"
|
||||
t.integer "user_id"
|
||||
t.text "text"
|
||||
|
|
@ -361,7 +371,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["order_id"], name: "index_order_comments_on_order_id"
|
||||
end
|
||||
|
||||
create_table "orders", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "orders", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "supplier_id"
|
||||
t.text "note"
|
||||
t.datetime "starts", precision: nil
|
||||
|
|
@ -380,7 +390,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["state"], name: "index_orders_on_state"
|
||||
end
|
||||
|
||||
create_table "page_versions", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "page_versions", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "page_id"
|
||||
t.integer "lock_version"
|
||||
t.text "body"
|
||||
|
|
@ -391,7 +401,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["page_id"], name: "index_page_versions_on_page_id"
|
||||
end
|
||||
|
||||
create_table "pages", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "pages", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.text "body"
|
||||
t.string "permalink"
|
||||
|
|
@ -405,20 +415,20 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["title"], name: "index_pages_on_title"
|
||||
end
|
||||
|
||||
create_table "periodic_task_groups", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "periodic_task_groups", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.date "next_task_date"
|
||||
t.datetime "created_at", precision: nil, null: false
|
||||
t.datetime "updated_at", precision: nil, null: false
|
||||
end
|
||||
|
||||
create_table "poll_choices", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "poll_choices", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "poll_vote_id", null: false
|
||||
t.integer "choice", null: false
|
||||
t.integer "value", null: false
|
||||
t.index ["poll_vote_id", "choice"], name: "index_poll_choices_on_poll_vote_id_and_choice", unique: true
|
||||
end
|
||||
|
||||
create_table "poll_votes", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "poll_votes", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "poll_id", null: false
|
||||
t.integer "user_id", null: false
|
||||
t.integer "ordergroup_id"
|
||||
|
|
@ -428,7 +438,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["poll_id", "user_id", "ordergroup_id"], name: "index_poll_votes_on_poll_id_and_user_id_and_ordergroup_id", unique: true
|
||||
end
|
||||
|
||||
create_table "polls", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "polls", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "created_by_user_id", null: false
|
||||
t.string "name", null: false
|
||||
t.text "description"
|
||||
|
|
@ -448,7 +458,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["final_choice"], name: "index_polls_on_final_choice"
|
||||
end
|
||||
|
||||
create_table "printer_job_updates", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "printer_job_updates", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "printer_job_id", null: false
|
||||
t.datetime "created_at", precision: nil, null: false
|
||||
t.string "state", null: false
|
||||
|
|
@ -456,7 +466,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["printer_job_id", "created_at"], name: "index_printer_job_updates_on_printer_job_id_and_created_at"
|
||||
end
|
||||
|
||||
create_table "printer_jobs", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "printer_jobs", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "order_id"
|
||||
t.string "document", null: false
|
||||
t.integer "created_by_user_id", null: false
|
||||
|
|
@ -465,7 +475,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["finished_at"], name: "index_printer_jobs_on_finished_at"
|
||||
end
|
||||
|
||||
create_table "settings", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "settings", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "var", null: false
|
||||
t.text "value"
|
||||
t.integer "thing_id"
|
||||
|
|
@ -475,7 +485,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["thing_type", "thing_id", "var"], name: "index_settings_on_thing_type_and_thing_id_and_var", unique: true
|
||||
end
|
||||
|
||||
create_table "stock_changes", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "stock_changes", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "stock_event_id"
|
||||
t.integer "order_id"
|
||||
t.integer "stock_article_id"
|
||||
|
|
@ -485,7 +495,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["stock_event_id"], name: "index_stock_changes_on_stock_event_id"
|
||||
end
|
||||
|
||||
create_table "stock_events", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "stock_events", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.integer "supplier_id"
|
||||
t.date "date"
|
||||
t.datetime "created_at", precision: nil
|
||||
|
|
@ -495,14 +505,14 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["supplier_id"], name: "index_stock_events_on_supplier_id"
|
||||
end
|
||||
|
||||
create_table "supplier_categories", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "supplier_categories", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "description"
|
||||
t.integer "financial_transaction_class_id"
|
||||
t.integer "bank_account_id"
|
||||
end
|
||||
|
||||
create_table "suppliers", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "suppliers", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", default: "", null: false
|
||||
t.string "address", default: "", null: false
|
||||
t.string "phone", default: "", null: false
|
||||
|
|
@ -524,7 +534,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["name"], name: "index_suppliers_on_name", unique: true
|
||||
end
|
||||
|
||||
create_table "tasks", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "tasks", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "name", default: "", null: false
|
||||
t.text "description"
|
||||
t.date "due_date"
|
||||
|
|
@ -541,7 +551,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_22_120005) do
|
|||
t.index ["workgroup_id"], name: "index_tasks_on_workgroup_id"
|
||||
end
|
||||
|
||||
create_table "users", id: :integer, charset: "utf8mb4", collation: "utf8mb4_general_ci", force: :cascade do |t|
|
||||
create_table "users", id: :integer, charset: "utf8mb4", force: :cascade do |t|
|
||||
t.string "nick"
|
||||
t.string "password_hash", default: "", null: false
|
||||
t.string "password_salt", default: "", null: false
|
||||
|
|
|
|||
147
db/seeds/demo.seeds.rb
Normal file
147
db/seeds/demo.seeds.rb
Normal file
|
|
@ -0,0 +1,147 @@
|
|||
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")
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue