<?php

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

class CreateEmpresaTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('empresa', function (Blueprint $table) {
            $table->integer('id_empresa')->autoIncrement();
            $table->string('razon_social', 200);
            $table->string('ruc', 11);
            $table->string('representante', 100);
            $table->string('dni', 15);
            $table->string('autorizacion', 50);
            $table->string('direccion', 200);
            $table->string('telefono', 30)->nullable();
            $table->string('pagina_web', 50)->nullable();
            $table->string('email', 50)->nullable();
            $table->string('ubigeo', 10)->nullable();
            $table->decimal('valor_impuesto', 9, 2)->nullable();
            $table->decimal('valor_icbper', 9, 2)->nullable();
            $table->tinyInteger('modulo_puntos')->default('0');
            $table->integer('id_sujeto_detraccion')->nullable();
            $table->integer('id_medios_pago')->nullable();
            $table->decimal('porcentaje_detraccion', 9, 2)->nullable();
            $table->decimal('porcentaje_retencion', 9, 2)->nullable();
            $table->string('cuenta_detraccion', 30)->nullable();
            $table->string('numeros_cuenta', 500)->nullable();
            $table->string('descripcion_empresa', 500)->nullable();

            $table->string('campo1', 200)->nullable();
            $table->string('campo2', 200)->nullable();
          
            $table->tinyInteger('estado')->default('1');
            $table->timestamps();

 

        });
    }

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