This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteUnidadeTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_unidade', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_centro_custo_id')->on('cadastro_centro_custo')->nullable();
|
||||
$table->string('nome', 100)->unique();
|
||||
$table->string('cnes', 7)->nullable();
|
||||
$table->boolean('is_almoxarifado');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_unidade');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteMaterialTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_material', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_material_id')->on('cadastro_material')->nullable();
|
||||
$table->string('nome', 100)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_material');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteFornecedorTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_fornecedor', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_fornecedor_id')->on('cadastro_fornecedor')->nullable();
|
||||
$table->string('nome', 100)->unique();
|
||||
$table->string('cnpj', 14)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_fornecedor');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteFabricanteTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_fabricante', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_fabricante_id')->on('cadastro_fabricante')->nullable();
|
||||
$table->string('nome', 100)->unique();
|
||||
$table->string('cnpj', 14)->nullable();
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_fabricante');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClientePeriodoContabilTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_periodo_contabil', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->date('inicio');
|
||||
$table->date('fim');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_periodo_contabil');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteEntradaStatusTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_entrada_status', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 50)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_entrada_status');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteEntradaDocumentoTipoTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_entrada_documento_tipo', function (Blueprint $table) {
|
||||
|
||||
MigrationUtil::idWithoutIncrements($table);
|
||||
|
||||
$table->string('nome', 50)->unique();
|
||||
|
||||
MigrationUtil::addCommonFields($table, ['staticData' => true]);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_entrada_documento_tipo');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteEntradaTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_entrada', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('conectasus_entrada_id')->nullable()->constrained('almoxarifado_entrada');
|
||||
$table->foreignId('unidade_id')->constrained('web_service_almoxarifado_cliente_unidade');
|
||||
$table->foreignId('fornecedor_id')->constrained('web_service_almoxarifado_cliente_fornecedor');
|
||||
$table->unsignedBigInteger('codigo_nota');
|
||||
$table->foreignId('documento_tipo_id')->constrained('web_service_almoxarifado_cliente_entrada_documento_tipo');
|
||||
$table->date('data_documento');
|
||||
$table->string('numero_documento', 10)->nullable();
|
||||
$table->string('numero_pedido', 20)->nullable();
|
||||
$table->foreignId('status_id')->constrained('web_service_almoxarifado_cliente_entrada_status');
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_entrada');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateWebServiceAlmoxarifadoClienteEntradaItemTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('web_service_almoxarifado_cliente_entrada_item', function (Blueprint $table) {
|
||||
|
||||
$table->id();
|
||||
$table->foreignId('entrada_id')->constrained('web_service_almoxarifado_cliente_entrada')->onDelete('cascade');
|
||||
$table->foreignId('material_id')->constrained('web_service_almoxarifado_cliente_material');
|
||||
$table->foreignId('fabricante_id')->constrained('web_service_almoxarifado_cliente_fabricante');
|
||||
$table->string('lote', 15);
|
||||
$table->date('validade_lote');
|
||||
$table->integer('quantidade');
|
||||
$table->decimal('valor_unitario', 14, 6);
|
||||
|
||||
MigrationUtil::addCommonFields($table);
|
||||
MigrationUtil::addExternalFields($table);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('web_service_almoxarifado_cliente_entrada_item');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user