<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreatePoReceiptVoucherDetailsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('po_receipt_voucher_details', function (Blueprint $table) {
            $table->id();
            $table->bigInteger('po_receipt_voucher_id')->nullable()->unsigned();
            $table->foreign('po_receipt_voucher_id')->references('id')->on('po_receipt_voucher');
            $table->bigInteger('product_id')->nullable()->unsigned();
            $table->foreign('product_id')->references('id')->on('products');
            $table->double('qty')->nullable();
            $table->double('modified_amount')->nullable();
            $table->bigInteger('indirect_tax_id')->nullable()->unsigned();
            $table->foreign('indirect_tax_id')->references('id')->on('indirect_tax');
            $table->date('delivery_date')->nullable();
            $table->double('advance_amount')->nullable();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('po_receipt_voucher_details');
    }
}
