class CreateOrderHists < ActiveRecord::Migration[6.0]
  def change
    create_table :order_hists do |t|
      t.string :past_code_client
      t.string :numero_piece
      t.string :numerofacture
      t.string :d_number
      t.date :date_creation
      t.date :date_modification
      t.date :date_piece
      t.date :date_facture
      t.integer :p_payment_type_id
      t.integer :p_commercial_id
      t.integer :p_customer_id
      t.decimal :montant_ht,   :precision => 14,   :scale => 2
      t.decimal :montant_ht_remise,   :precision => 14,   :scale => 2
      t.decimal :montant_ht_com,   :precision => 14,   :scale => 2
      t.decimal :cout_achat_ht,   :precision => 14,   :scale => 2
      t.decimal :marge_brut_hors_remise,   :precision => 14,   :scale => 2
      t.decimal :marge_brut_remise,   :precision => 14,   :scale => 2
      t.decimal :marge_net,   :precision => 14,   :scale => 2
      t.decimal :marge_brut_hors_remise_pa,   :precision => 14,   :scale => 2
      t.decimal :marge_brut_remise_pa,   :precision => 14,   :scale => 2
      t.decimal :marge_net_ht_pa,   :precision => 14,   :scale => 2
   
      
      t.timestamps
    end
  end
end
