diff --git a/app/models/p_customer.rb b/app/models/p_customer.rb index d622a3a..372e15b 100644 --- a/app/models/p_customer.rb +++ b/app/models/p_customer.rb @@ -533,7 +533,7 @@ class PCustomer < ApplicationRecord :adresse_banque_1, :adresse_banque_2, :adresse_banque_3, - :code_banque, + :code_postal_banque, :ville_banque, :pays_banque, :code_banque, @@ -603,7 +603,7 @@ class PCustomer < ApplicationRecord #OK Adresse 1 Banque :p_bank.particular.address_1 OK :adresse_banque_1 #OK Adresse 2 Banque :p_bank.particular.address_2 OK :adresse_banque_2 #OK Adresse 3 Banque VIDE OK :adresse_banque_3 - #OK Code Postal Banque :p_bank.particular.cp OK :code_banque + #OK Code Postal Banque :p_bank.particular.cp OK :code_postal_banque #OK Ville Banque :p_bank.particular.ville OK :ville_banque #OK Pays Banque :p_bank.particular.pays OK :pays_banque #OK Code Banque INUTILE OK :code_banque @@ -661,11 +661,11 @@ class PCustomer < ApplicationRecord n = self.new(imported: true, p_customer_cat: PCustomerCat.find_by_name("Professionnel")) # particular = Particular.new(pro: true) - particular_bill = Particular.new + particular_bill = Particular.new(pro: true) bank = bic = iban = p_commercial = particular_send = send_tel = send_tel2 = send_fax = send_address_2 = p_commercial_code = p_commercial_firstname = contact_2 = nil - bank_particular = Particular.new + bank_particular = Particular.new(pro: true) contact = PContact.new row.each do |key, value| @@ -759,7 +759,7 @@ class PCustomer < ApplicationRecord when "adresse_banque_2" bank_particular.address_2 = value if !value.blank? - when "code_banque" + when "code_postal_banque" bank_particular.cp = value if !value.blank? when "ville_banque" @@ -870,6 +870,7 @@ class PCustomer < ApplicationRecord if bank bank.bic = bic + bank_particular.organisation = bank.name bank.particulars << bank_particular if bank_particular.address_1 bank.save! import_csv.import_csv_elements << ImportCsvElement.new(:element => bank) diff --git a/db/schema.rb b/db/schema.rb index 66c23b3..68d0a77 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1167,6 +1167,7 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do t.string "contactable_type", limit: 255 t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.string "skype" t.index ["contactable_id"], name: "idx_55093_index_p_contacts_on_contactable_id" end @@ -1453,6 +1454,17 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do t.index ["p_fournisseur_id"], name: "idx_55335_index_p_fournisseur_orders_on_p_fournisseur_id" end + create_table "p_fournisseur_refs", force: :cascade do |t| + t.string "ref" + t.string "label" + t.bigint "p_product_ref_id" + t.bigint "p_fournisseur_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["p_fournisseur_id"], name: "index_p_fournisseur_refs_on_p_fournisseur_id" + t.index ["p_product_ref_id"], name: "index_p_fournisseur_refs_on_p_product_ref_id" + end + create_table "p_fournisseurs", force: :cascade do |t| t.string "name", limit: 255 t.string "code", limit: 255 @@ -1466,6 +1478,11 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do t.string "compta_account", limit: 255 t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.integer "payment_delais" + t.string "tva_num" + t.integer "p_payment_type_id" + t.string "iban" + t.string "bic" end create_table "p_grades", force: :cascade do |t| @@ -1796,6 +1813,33 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do t.boolean "stocked", default: true t.text "description" t.bigint "p_product_color_id" + t.decimal "ac_sorecop", precision: 10, scale: 2 + t.decimal "cc_sorecop", precision: 10, scale: 2 + t.decimal "ct_sorecop", precision: 10, scale: 2 + t.decimal "ac_deee", precision: 10, scale: 2 + t.decimal "cc_deee", precision: 10, scale: 2 + t.decimal "ct_deee", precision: 10, scale: 2 + t.string "ean" + t.string "sorecop_comment" + t.string "genecode" + t.string "manufacturer_ref" + t.string "used_state" + t.string "i_code_hs" + t.decimal "prepair_score", precision: 10, scale: 2 + t.string "part_delay" + t.string "das_head" + t.string "das_body" + t.string "das_membre" + t.integer "nb_pcs_colis" + t.string "code_om" + t.string "gbh_code_971" + t.string "gbh_code_972" + t.string "gbh_code_973" + t.string "code_art" + t.string "i_comment" + t.string "i_pmp_hors_sorecop" + t.string "i_target_hors_sorecop" + t.integer "p_fournisseur_id" end create_table "p_product_specs", force: :cascade do |t| @@ -1885,6 +1929,7 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do t.decimal "finesse_max", precision: 6, scale: 2 t.boolean "conserve_proportion", default: false t.boolean "frontpage", default: true + t.integer "sorecop_cat_id" t.index ["p_product_cat_id"], name: "idx_55431_index_p_products_on_p_product_cat_id" t.index ["s_brand_id"], name: "idx_55431_index_p_products_on_s_brand_id" end @@ -2254,6 +2299,11 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do t.string "f_token", limit: 255 t.text "acheteur_text" t.string "public_fournisseur_name", limit: 255 + t.integer "bon_de_commande_achat_id" + t.integer "bon_de_reception_achat_id" + t.integer "demande_de_prix_id" + t.integer "avoir_achat_id" + t.integer "facture_achat_id" t.index ["p_customer_id"], name: "idx_54688_index_price_documents_on_p_customer_id" end @@ -2406,6 +2456,13 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do t.index ["p_customer_id"], name: "idx_54863_index_price_line_blocks_on_p_customer_id" end + create_table "price_line_resp_selects", force: :cascade do |t| + t.integer "price_line_demand_id" + t.integer "price_line_resp_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + create_table "price_lines", force: :cascade do |t| t.boolean "archived" t.bigint "price_line_block_id" @@ -2737,6 +2794,24 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do t.decimal "ac_remise", precision: 14, scale: 2 end + create_table "sorecop_cats", force: :cascade do |t| + t.string "name" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + end + + create_table "sorecop_taxes", force: :cascade do |t| + t.decimal "critere_min", precision: 14, scale: 3 + t.decimal "critere_max", precision: 14, scale: 3 + t.string "title" + t.boolean "fixed_price", default: true + t.decimal "price", precision: 10, scale: 2 + t.bigint "sorecop_cat_id" + t.datetime "created_at", precision: 6, null: false + t.datetime "updated_at", precision: 6, null: false + t.index ["sorecop_cat_id"], name: "index_sorecop_taxes_on_sorecop_cat_id" + end + create_table "specific_preferences", force: :cascade do |t| t.string "key", limit: 255 t.string "value", limit: 255 @@ -3135,6 +3210,8 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do add_foreign_key "p_customer_product_prices", "p_customers", on_update: :restrict, on_delete: :restrict add_foreign_key "p_customer_product_prices", "p_product_refs", on_update: :restrict, on_delete: :restrict add_foreign_key "p_customer_ribs", "p_customers", on_update: :restrict, on_delete: :restrict + add_foreign_key "p_fournisseur_refs", "p_fournisseurs" + add_foreign_key "p_fournisseur_refs", "p_product_refs" add_foreign_key "p_product_aromes", "p_aromes", on_update: :restrict, on_delete: :restrict add_foreign_key "p_product_aromes", "p_products", on_update: :restrict, on_delete: :restrict add_foreign_key "p_product_images", "image_files", on_update: :restrict, on_delete: :restrict @@ -3159,6 +3236,7 @@ ActiveRecord::Schema.define(version: 2021_10_18_142636) do add_foreign_key "partition_lines", "partitions", on_update: :restrict, on_delete: :restrict add_foreign_key "partitions", "admins", on_update: :restrict, on_delete: :restrict add_foreign_key "s_modules", "s_modules_states", on_update: :restrict, on_delete: :restrict + add_foreign_key "sorecop_taxes", "sorecop_cats" add_foreign_key "stat_lines", "p_commercials", on_update: :restrict, on_delete: :restrict add_foreign_key "stat_lines", "p_customers", on_update: :restrict, on_delete: :restrict add_foreign_key "stat_lines", "p_product_refs", on_update: :restrict, on_delete: :restrict