|
@@ -11,7 +11,7 @@
|
|
|
#
|
|
#
|
|
|
# It's strongly recommended that you check this file into your version control system.
|
|
# It's strongly recommended that you check this file into your version control system.
|
|
|
|
|
|
|
|
-ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
|
|
|
|
+ActiveRecord::Schema.define(version: 20181221220426) do
|
|
|
|
|
|
|
|
# These are extensions that must be enabled in order to support this database
|
|
# These are extensions that must be enabled in order to support this database
|
|
|
enable_extension "plpgsql"
|
|
enable_extension "plpgsql"
|
|
@@ -55,21 +55,22 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
add_index "available_products", ["product_id"], name: "index_available_products_on_product_id", using: :btree
|
|
add_index "available_products", ["product_id"], name: "index_available_products_on_product_id", using: :btree
|
|
|
|
|
|
|
|
create_table "billing_informations", force: :cascade do |t|
|
|
create_table "billing_informations", force: :cascade do |t|
|
|
|
- t.integer "customer_id", default: 0, null: false
|
|
|
|
|
- t.string "name", limit: 255, default: "", null: false
|
|
|
|
|
- t.string "rfc", limit: 13, default: "", null: false
|
|
|
|
|
- t.string "address", limit: 255, default: "", null: false
|
|
|
|
|
- t.integer "zipcode", default: 0, null: false
|
|
|
|
|
- t.string "num_ext", default: "", null: false
|
|
|
|
|
- t.string "num_int", default: "", null: false
|
|
|
|
|
- t.integer "state_id", default: 0, null: false
|
|
|
|
|
- t.integer "county_id", default: 0, null: false
|
|
|
|
|
- t.string "city", default: "", null: false
|
|
|
|
|
- t.string "suburb", default: "", null: false
|
|
|
|
|
- t.integer "status", default: 1, null: false
|
|
|
|
|
- t.datetime "created_at", null: false
|
|
|
|
|
- t.datetime "updated_at", null: false
|
|
|
|
|
- t.integer "supplier_id", default: 0, null: false
|
|
|
|
|
|
|
+ t.integer "customer_id", default: 0, null: false
|
|
|
|
|
+ t.string "name", limit: 255, default: "", null: false
|
|
|
|
|
+ t.string "rfc", limit: 13, default: "", null: false
|
|
|
|
|
+ t.string "address", limit: 255, default: "", null: false
|
|
|
|
|
+ t.integer "zipcode", default: 0, null: false
|
|
|
|
|
+ t.string "num_ext", default: "", null: false
|
|
|
|
|
+ t.string "num_int", default: "", null: false
|
|
|
|
|
+ t.integer "state_id", default: 0, null: false
|
|
|
|
|
+ t.integer "county_id", default: 0, null: false
|
|
|
|
|
+ t.string "city", default: "", null: false
|
|
|
|
|
+ t.string "suburb", default: "", null: false
|
|
|
|
|
+ t.integer "status", default: 1, null: false
|
|
|
|
|
+ t.datetime "created_at", null: false
|
|
|
|
|
+ t.datetime "updated_at", null: false
|
|
|
|
|
+ t.integer "supplier_id", default: 0, null: false
|
|
|
|
|
+ t.string "cfdi_use_key", default: "G03"
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
add_index "billing_informations", ["county_id"], name: "index_billing_informations_on_county_id", using: :btree
|
|
add_index "billing_informations", ["county_id"], name: "index_billing_informations_on_county_id", using: :btree
|
|
@@ -103,6 +104,7 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
t.decimal "cash_fund", precision: 10, scale: 2, default: 0.0
|
|
t.decimal "cash_fund", precision: 10, scale: 2, default: 0.0
|
|
|
t.decimal "physical_cash", precision: 10, scale: 2, default: 0.0, null: false
|
|
t.decimal "physical_cash", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
t.string "observations"
|
|
t.string "observations"
|
|
|
|
|
+ t.string "invoice_num"
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
add_index "cash_outs", ["open_cash_register_id"], name: "index_cash_outs_on_open_cash_register_id", using: :btree
|
|
add_index "cash_outs", ["open_cash_register_id"], name: "index_cash_outs_on_open_cash_register_id", using: :btree
|
|
@@ -136,6 +138,10 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
t.decimal "change", precision: 10, scale: 2
|
|
t.decimal "change", precision: 10, scale: 2
|
|
|
t.integer "products_return_id"
|
|
t.integer "products_return_id"
|
|
|
t.integer "credit_payment_id"
|
|
t.integer "credit_payment_id"
|
|
|
|
|
+ t.string "bank_name", default: ""
|
|
|
|
|
+ t.string "check_number", default: ""
|
|
|
|
|
+ t.string "customer_account", default: ""
|
|
|
|
|
+ t.string "customer_code", default: ""
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
add_index "cash_registers_moves", ["open_cash_register_id"], name: "index_cash_registers_moves_on_open_cash_register_id", using: :btree
|
|
add_index "cash_registers_moves", ["open_cash_register_id"], name: "index_cash_registers_moves_on_open_cash_register_id", using: :btree
|
|
@@ -185,12 +191,13 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
t.integer "customer_id"
|
|
t.integer "customer_id"
|
|
|
t.integer "credit_id"
|
|
t.integer "credit_id"
|
|
|
t.integer "pointsale_id"
|
|
t.integer "pointsale_id"
|
|
|
- t.decimal "quantity", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
- t.integer "status", default: 0, null: false
|
|
|
|
|
- t.date "date_payment", null: false
|
|
|
|
|
- t.datetime "created_at", null: false
|
|
|
|
|
- t.datetime "updated_at", null: false
|
|
|
|
|
|
|
+ t.decimal "quantity", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
+ t.integer "status", default: 0, null: false
|
|
|
|
|
+ t.date "date_payment", null: false
|
|
|
|
|
+ t.datetime "created_at", null: false
|
|
|
|
|
+ t.datetime "updated_at", null: false
|
|
|
t.integer "user_id"
|
|
t.integer "user_id"
|
|
|
|
|
+ t.integer "cash_registers_move_id"
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
add_index "credit_payments", ["credit_id"], name: "index_credit_payments_on_credit_id", using: :btree
|
|
add_index "credit_payments", ["credit_id"], name: "index_credit_payments_on_credit_id", using: :btree
|
|
@@ -288,6 +295,22 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
add_index "inventories_moves", ["purchase_id"], name: "index_inventories_moves_on_purchase_id", using: :btree
|
|
add_index "inventories_moves", ["purchase_id"], name: "index_inventories_moves_on_purchase_id", using: :btree
|
|
|
add_index "inventories_moves", ["sale_id"], name: "index_inventories_moves_on_sale_id", using: :btree
|
|
add_index "inventories_moves", ["sale_id"], name: "index_inventories_moves_on_sale_id", using: :btree
|
|
|
|
|
|
|
|
|
|
+ create_table "invoice_details", force: :cascade do |t|
|
|
|
|
|
+ t.integer "sale_id"
|
|
|
|
|
+ t.string "uuid", null: false
|
|
|
|
|
+ t.string "cfdi_type", limit: 1, null: false
|
|
|
|
|
+ t.string "invoice_reason"
|
|
|
|
|
+ t.string "rfc_receptor"
|
|
|
|
|
+ t.datetime "generating_date"
|
|
|
|
|
+ t.datetime "stamping_date"
|
|
|
|
|
+ t.string "storing_url"
|
|
|
|
|
+ t.integer "status", limit: 2, default: 1
|
|
|
|
|
+ t.datetime "created_at", null: false
|
|
|
|
|
+ t.datetime "updated_at", null: false
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ add_index "invoice_details", ["sale_id"], name: "index_invoice_details_on_sale_id", using: :btree
|
|
|
|
|
+
|
|
|
create_table "open_cash_registers", force: :cascade do |t|
|
|
create_table "open_cash_registers", force: :cascade do |t|
|
|
|
t.integer "cash_register_id"
|
|
t.integer "cash_register_id"
|
|
|
t.integer "user_id"
|
|
t.integer "user_id"
|
|
@@ -302,21 +325,22 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
add_index "open_cash_registers", ["user_id"], name: "index_open_cash_registers_on_user_id", using: :btree
|
|
add_index "open_cash_registers", ["user_id"], name: "index_open_cash_registers_on_user_id", using: :btree
|
|
|
|
|
|
|
|
create_table "payment_methods", force: :cascade do |t|
|
|
create_table "payment_methods", force: :cascade do |t|
|
|
|
- t.string "method", null: false
|
|
|
|
|
- t.integer "status", default: 1, null: false
|
|
|
|
|
- t.datetime "created_at", null: false
|
|
|
|
|
- t.datetime "updated_at", null: false
|
|
|
|
|
|
|
+ t.string "method", null: false
|
|
|
|
|
+ t.integer "status", default: 1, null: false
|
|
|
|
|
+ t.datetime "created_at", null: false
|
|
|
|
|
+ t.datetime "updated_at", null: false
|
|
|
t.integer "reference"
|
|
t.integer "reference"
|
|
|
- t.integer "isCash", default: 0, null: false
|
|
|
|
|
|
|
+ t.integer "isCash", default: 0, null: false
|
|
|
|
|
+ t.string "payment_method_key", default: "99"
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
create_table "pointsales", force: :cascade do |t|
|
|
create_table "pointsales", force: :cascade do |t|
|
|
|
t.string "name"
|
|
t.string "name"
|
|
|
t.string "address"
|
|
t.string "address"
|
|
|
t.text "notes"
|
|
t.text "notes"
|
|
|
- t.integer "status", default: 1
|
|
|
|
|
- t.datetime "created_at", null: false
|
|
|
|
|
- t.datetime "updated_at", null: false
|
|
|
|
|
|
|
+ t.integer "status", default: 1
|
|
|
|
|
+ t.datetime "created_at", null: false
|
|
|
|
|
+ t.datetime "updated_at", null: false
|
|
|
t.text "prefix"
|
|
t.text "prefix"
|
|
|
t.string "img_pointsale_file_name"
|
|
t.string "img_pointsale_file_name"
|
|
|
t.string "img_pointsale_content_type"
|
|
t.string "img_pointsale_content_type"
|
|
@@ -324,7 +348,11 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
t.datetime "img_pointsale_updated_at"
|
|
t.datetime "img_pointsale_updated_at"
|
|
|
t.string "ticket_footer"
|
|
t.string "ticket_footer"
|
|
|
t.string "img_pointsale"
|
|
t.string "img_pointsale"
|
|
|
- t.decimal "haggle_percent", precision: 10, scale: 2, default: 0.0
|
|
|
|
|
|
|
+ t.decimal "haggle_percent", precision: 10, scale: 2, default: 0.0
|
|
|
|
|
+ t.string "federal_taxpayer_registration"
|
|
|
|
|
+ t.string "business_name"
|
|
|
|
|
+ t.integer "tax_regime"
|
|
|
|
|
+ t.integer "postal_code"
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
create_table "pos_configs", force: :cascade do |t|
|
|
create_table "pos_configs", force: :cascade do |t|
|
|
@@ -421,24 +449,24 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
add_index "product_wastes", ["product_id"], name: "index_product_wastes_on_product_id", using: :btree
|
|
add_index "product_wastes", ["product_id"], name: "index_product_wastes_on_product_id", using: :btree
|
|
|
|
|
|
|
|
create_table "products", force: :cascade do |t|
|
|
create_table "products", force: :cascade do |t|
|
|
|
- t.string "sku", limit: 30, default: "", null: false
|
|
|
|
|
- t.string "name", limit: 255, default: "", null: false
|
|
|
|
|
- t.text "description", default: "", null: false
|
|
|
|
|
|
|
+ t.string "sku", limit: 30, default: "", null: false
|
|
|
|
|
+ t.string "name", limit: 255, default: "", null: false
|
|
|
|
|
+ t.text "description", default: "", null: false
|
|
|
t.decimal "price_base", precision: 10, scale: 2, default: 0.0
|
|
t.decimal "price_base", precision: 10, scale: 2, default: 0.0
|
|
|
t.decimal "price_sale", precision: 10, scale: 2, default: 0.0
|
|
t.decimal "price_sale", precision: 10, scale: 2, default: 0.0
|
|
|
t.string "img_product_file_name"
|
|
t.string "img_product_file_name"
|
|
|
t.string "img_product_content_type"
|
|
t.string "img_product_content_type"
|
|
|
t.integer "img_product_file_size"
|
|
t.integer "img_product_file_size"
|
|
|
t.datetime "img_product_updated_at"
|
|
t.datetime "img_product_updated_at"
|
|
|
- t.boolean "presentation", default: false, null: false
|
|
|
|
|
- t.boolean "inventory", default: true, null: false
|
|
|
|
|
|
|
+ t.boolean "presentation", default: false, null: false
|
|
|
|
|
+ t.boolean "inventory", default: true, null: false
|
|
|
t.decimal "content"
|
|
t.decimal "content"
|
|
|
- t.integer "status", default: 1, null: false
|
|
|
|
|
- t.datetime "created_at", null: false
|
|
|
|
|
- t.datetime "updated_at", null: false
|
|
|
|
|
|
|
+ t.integer "status", default: 1, null: false
|
|
|
|
|
+ t.datetime "created_at", null: false
|
|
|
|
|
+ t.datetime "updated_at", null: false
|
|
|
t.integer "unit_id"
|
|
t.integer "unit_id"
|
|
|
- t.integer "include_purchase_tax", default: 0, null: false
|
|
|
|
|
- t.integer "include_sale_tax", default: 0, null: false
|
|
|
|
|
|
|
+ t.integer "include_purchase_tax", default: 0, null: false
|
|
|
|
|
+ t.integer "include_sale_tax", default: 0, null: false
|
|
|
t.string "barcode"
|
|
t.string "barcode"
|
|
|
t.integer "parent_id"
|
|
t.integer "parent_id"
|
|
|
t.text "attributes_json"
|
|
t.text "attributes_json"
|
|
@@ -447,6 +475,7 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
t.decimal "price_base_dollars", precision: 10, scale: 2
|
|
t.decimal "price_base_dollars", precision: 10, scale: 2
|
|
|
t.string "img_product"
|
|
t.string "img_product"
|
|
|
t.integer "category_id"
|
|
t.integer "category_id"
|
|
|
|
|
+ t.string "product_service_key", default: "01010101"
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
add_index "products", ["unit_id"], name: "index_products_on_unit_id", using: :btree
|
|
add_index "products", ["unit_id"], name: "index_products_on_unit_id", using: :btree
|
|
@@ -560,19 +589,21 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
t.integer "customer_id"
|
|
t.integer "customer_id"
|
|
|
t.integer "user_id"
|
|
t.integer "user_id"
|
|
|
t.integer "open_cash_register_id"
|
|
t.integer "open_cash_register_id"
|
|
|
- t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
- t.decimal "tax", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
- t.decimal "discount", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
- t.decimal "total", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
- t.integer "status", default: 1, null: false
|
|
|
|
|
- t.date "date_sale", null: false
|
|
|
|
|
- t.datetime "created_at", null: false
|
|
|
|
|
- t.datetime "updated_at", null: false
|
|
|
|
|
|
|
+ t.decimal "amount", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
+ t.decimal "tax", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
+ t.decimal "discount", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
+ t.decimal "total", precision: 10, scale: 2, default: 0.0, null: false
|
|
|
|
|
+ t.integer "status", default: 1, null: false
|
|
|
|
|
+ t.date "date_sale", null: false
|
|
|
|
|
+ t.datetime "created_at", null: false
|
|
|
|
|
+ t.datetime "updated_at", null: false
|
|
|
t.integer "saletype", limit: 2
|
|
t.integer "saletype", limit: 2
|
|
|
t.integer "seller_id"
|
|
t.integer "seller_id"
|
|
|
t.string "sale_code"
|
|
t.string "sale_code"
|
|
|
t.date "expiration_date"
|
|
t.date "expiration_date"
|
|
|
t.string "credit_note"
|
|
t.string "credit_note"
|
|
|
|
|
+ t.string "invoice_num"
|
|
|
|
|
+ t.boolean "require_invoice", default: false
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
add_index "sales", ["customer_id"], name: "index_sales_on_customer_id", using: :btree
|
|
add_index "sales", ["customer_id"], name: "index_sales_on_customer_id", using: :btree
|
|
@@ -750,8 +781,9 @@ ActiveRecord::Schema.define(version: 20181122030513) do
|
|
|
create_table "units", force: :cascade do |t|
|
|
create_table "units", force: :cascade do |t|
|
|
|
t.string "unit"
|
|
t.string "unit"
|
|
|
t.integer "status"
|
|
t.integer "status"
|
|
|
- t.datetime "created_at", null: false
|
|
|
|
|
- t.datetime "updated_at", null: false
|
|
|
|
|
|
|
+ t.datetime "created_at", null: false
|
|
|
|
|
+ t.datetime "updated_at", null: false
|
|
|
|
|
+ t.string "unit_key", default: ""
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
create_table "users", force: :cascade do |t|
|
|
create_table "users", force: :cascade do |t|
|