<?php

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

class CreateVendorPaymentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('vendor_payments', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('vendor_id')->nullable();
            $table->unsignedInteger('debit_account_id')->nullable();
            $table->unsignedInteger('credit_account_id')->nullable();

            // $table->unsignedInteger('user_id')->nullable();
            $table->string('invoice_no')->nullable(); 

            $table->string('payment_option')->nullable(); // PAY NOW PAY LETTER
            $table->string('description',500)->nullable();
            $table->double('amount')->nullable();
            $table->double('received_amount')->nullable();
            $table->enum('status', ['Paid','Unpaid'])->default('Unpaid');
            $table->enum('is_recycle', ['0','1','2'])->default('0');
            $table->timestamps();
        });
    }

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