class CreateReceipts < ActiveRecord::Migration[5.1]
  def change
    create_table :receipts do |t|
      t.string  :client_code, :limit => 16, :null => false
      t.string  :client_name, :null => false
      t.string  :shop_code, :limit => 16, :null => false
      t.string  :shop_name, :null => false
      t.string :receipt_no, :null => false
      t.datetime  :transaction_time, :null => false
      t.datetime  :receipt_open_time, :null => false
      t.datetime  :receipt_close_time, :null => false
      t.string    :shift_id, :null => false
      t.datetime  :shift_open_time, :null => false
      t.datetime  :shift_close_time, :null => false
      t.decimal :gross_sales, :null => false, :default => 0
      t.decimal :discount_amount, :null => false, :default => 0
      t.decimal :sales, :null => false, :default => 0
      t.decimal :tax_amount, :null => false, :default => 0
      t.decimal :service_charges, :null => false, :default => 0
      t.decimal :net_sales, :null => false, :default => 0
      t.decimal :credit_card_sales, :null => false, :default => 0
      t.decimal :voucher_sales, :null => false, :default => 0
      t.decimal :foc_amount,  :null => false, :default => 0
      t.decimal :staff_meal_amount, :null => false, :default => 0
      t.decimal :rounding_amount, :null => false, :default => 0
      t.decimal :raw_wastage_amount, :null => false, :default => 0
      t.decimal :semi_wastage_amount, :null => false, :default => 0
      t.decimal :wastage_amount, :null => false, :default => 0
      t.decimal :spoilage_amount, :null => false, :default => 0
      t.decimal :sampling_amount, :null => false, :default => 0
      t.integer :qty, :null => false, :default => 0
      t.integer :no_of_pax, :null => false, :default => 0
      t.integer :no_of_adult, :null => false, :default => 0
      t.integer :no_of_child, :null => false, :default => 0
      t.string  :terminal_id, :null => false
      t.string  :employee_code, :limit => 4, :null => false
      t.string  :employee_name, :null => false
      t.boolean :is_valid, :null => false, :default => false
      t.boolean :overing, :null => false, :default => false
      t.boolean :cancle, :null => false, :default => false
      t.text    :remarks
      t.timestamps
    end
  end
end
