Fix Invoice/Estimate template issues and Add Payment Receipt, Custom Payment Modes and Item units

This commit is contained in:
Jay Makwana
2020-01-05 07:22:36 +00:00
committed by Mohit Panjwani
parent 56a955befd
commit 4c33a5d88c
112 changed files with 5050 additions and 331 deletions

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUnitsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('units', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('units');
}
}

View File

@ -21,6 +21,8 @@ class CreateItemsTable extends Migration
$table->unsignedBigInteger('price');
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->integer('unit_id')->unsigned()->nullable();
$table->foreign('unit_id')->references('id')->on('units')->onDelete('cascade');
$table->timestamps();
});
}

View File

@ -30,6 +30,6 @@ class CreateExpenseCategoriesTable extends Migration
*/
public function down()
{
Schema::dropIfExists('expenses_categories');
Schema::dropIfExists('expense_categories');
}
}

View File

@ -39,6 +39,6 @@ class CreateAddressesTable extends Migration
*/
public function down()
{
Schema::dropIfExists('address');
Schema::dropIfExists('addresses');
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePaymentMethodsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('payment_methods', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('payment_methods');
}
}

View File

@ -16,16 +16,18 @@ class CreatePaymentsTable extends Migration
Schema::create('payments', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('payment_number');
$table->string('payment_mode')->nullable();
$table->date('payment_date');
$table->text('notes')->nullable();
$table->unsignedBigInteger('amount');
$table->string('unique_hash')->nullable();
$table->integer('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->integer('invoice_id')->unsigned()->nullable();
$table->foreign('invoice_id')->references('id')->on('invoices')->onDelete('cascade');
$table->integer('company_id')->unsigned()->nullable();
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->integer('payment_method_id')->unsigned()->nullable();
$table->foreign('payment_method_id')->references('id')->on('payment_methods')->onDelete('cascade');
$table->timestamps();
});
}

View File

@ -0,0 +1,20 @@
<?php
use Illuminate\Database\Seeder;
use Crater\PaymentMethod;
class PaymentMethodSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
PaymentMethod::create(['name' => 'Cash', 'company_id' => 1]);
PaymentMethod::create(['name' => 'Check', 'company_id' => 1]);
PaymentMethod::create(['name' => 'Credit Card', 'company_id' => 1]);
PaymentMethod::create(['name' => 'Bank Transfer', 'company_id' => 1]);
}
}

View File

@ -0,0 +1,27 @@
<?php
use Illuminate\Database\Seeder;
use Crater\Unit;
class UnitSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Unit::create(['name' => 'box', 'company_id' => 1]);
Unit::create(['name' => 'cm', 'company_id' => 1]);
Unit::create(['name' => 'dz', 'company_id' => 1]);
Unit::create(['name' => 'ft', 'company_id' => 1]);
Unit::create(['name' => 'g', 'company_id' => 1]);
Unit::create(['name' => 'in', 'company_id' => 1]);
Unit::create(['name' => 'kg', 'company_id' => 1]);
Unit::create(['name' => 'km', 'company_id' => 1]);
Unit::create(['name' => 'lb', 'company_id' => 1]);
Unit::create(['name' => 'mg', 'company_id' => 1]);
Unit::create(['name' => 'pc', 'company_id' => 1]);
}
}