class CreatePriceLines < ActiveRecord::Migration[6.0]
  def change
    create_table :price_lines do |t|
      t.boolean :archived
      t.integer :price_line_block_id
      t.integer :position
      t.string  :line_type
      t.integer :ac_accounting_zone_id
      t.integer :cc_accounting_zone_id
      t.string  :ac_accounting_zone_name
      t.string  :cc_accounting_zone_name
      t.integer :ac_tva_account_id
      t.integer :cc_tva_account_id
      t.decimal :ac_tva_account_value, :precision => 5,   :scale => 2
      t.decimal :cc_tva_account_value, :precision => 5,   :scale => 2
      t.integer :p_product_id
      t.integer :p_product_variante_id
      t.integer :p_product_alt_id
      t.integer :p_product_alt_variante_id
      t.integer :p_product_ref_id
      t.integer :p_product_ref_variante_id
      t.string  :ct_ref
      t.string  :ac_ref
      t.string  :cc_ref
      t.string  :ct_title
      t.string  :ac_title
      t.string  :cc_title
      
      t.boolean :ac_product_remise_enrobage_ok
      t.boolean :cc_product_remise_enrobage_ok
      
      t.string :ac_uv
      t.string :cc_uv
      
      
      t.text    :ct_description
      t.text    :ac_description
      t.text    :cc_description
      
      
      
      
      t.decimal :ct_u_price_ht,   :precision => 14,   :scale => 2
      t.decimal :ac_price_u_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_price_u_ht,   :precision => 14,   :scale => 2
      t.decimal :ac_price_u_tva,   :precision => 14,   :scale => 2
      t.decimal :cc_price_u_tva,   :precision => 14,   :scale => 2
      t.decimal :ac_price_u_ttc,   :precision => 14,   :scale => 2
      t.decimal :cc_price_u_ttc,   :precision => 14,   :scale => 2
      t.integer :qte
      t.decimal :ac_tot_line_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_line_ht,   :precision => 14,   :scale => 2
      t.decimal :ac_tot_line_tva,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_line_tva,   :precision => 14,   :scale => 2
      t.decimal :ac_tot_line_ttc,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_line_ttc,   :precision => 14,   :scale => 2
      
      
      
      t.decimal :ac_discount_market_percent,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_market_percent,   :precision => 14,   :scale => 2
      t.decimal :ac_discount_market_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_market_ht,   :precision => 14,   :scale => 2
      
      t.decimal :ac_discount_qte_percent,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_qte_percent,   :precision => 14,   :scale => 2
      t.decimal :ac_discount_qte_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_qte_ht,   :precision => 14,   :scale => 2
      
      t.decimal :ac_discount_delay_percent,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_delay_percent,   :precision => 14,   :scale => 2
      t.decimal :ac_discount_delay_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_delay_ht,   :precision => 14,   :scale => 2
      
      t.decimal :ac_discount_enrobage_percent,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_enrobage_percent,   :precision => 14,   :scale => 2
      t.decimal :ac_discount_enrobage_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_enrobage_ht,   :precision => 14,   :scale => 2
      
      t.decimal :ac_discount_ecole_percent,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_ecole_percent,   :precision => 14,   :scale => 2
      t.decimal :ac_discount_ecole_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_ecole_ht,   :precision => 14,   :scale => 2
      
      t.decimal :ac_discount_comptant_percent,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_comptant_percent,   :precision => 14,   :scale => 2
      t.decimal :ac_discount_comptant_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_discount_comptant_ht,   :precision => 14,   :scale => 2
      
      
      
      
      t.decimal :ac_tot_discount_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_discount_ht,   :precision => 14,   :scale => 2
      t.decimal :ac_tot_discount_tva,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_discount_tva,   :precision => 14,   :scale => 2
      t.decimal :ac_tot_discount_ttc,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_discount_ttc,   :precision => 14,   :scale => 2
      t.decimal :ac_tot_amount_ht,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_amount_ht,   :precision => 14,   :scale => 2
      t.decimal :ac_tot_amount_tva,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_amount_tva,   :precision => 14,   :scale => 2
      t.decimal :ac_tot_amount_ttc,   :precision => 14,   :scale => 2
      t.decimal :cc_tot_amount_ttc,   :precision => 14,   :scale => 2
      t.integer :p_cter_id
      
      t.decimal :ct_weight_u,  :precision => 14,   :scale => 2
      t.decimal :ac_weight_u,  :precision => 14,   :scale => 2
      t.decimal :cc_weight_u,  :precision => 14,   :scale => 2
      
      t.decimal :ac_weight_tot,  :precision => 14,   :scale => 2
      t.decimal :cc_weight_tot,  :precision => 14,   :scale => 2

      t.timestamps
    end
  end
end
