Expand link view and more features #616

This commit is contained in:
James Cole
2017-08-21 18:16:15 +02:00
parent d00b9515de
commit a5013ecbc3
10 changed files with 281 additions and 45 deletions

View File

@@ -40,8 +40,7 @@ class ChangesForV470 extends Migration
$table->string('inward');
$table->boolean('editable');
$table->unique(['name']);
$table->unique(['outward','inward']);
$table->unique(['name', 'outward','inward']);
}
);
}
@@ -54,8 +53,7 @@ class ChangesForV470 extends Migration
$table->integer('link_type_id', false, true);
$table->integer('source_id', false, true);
$table->integer('destination_id', false, true);
$table->text('comment');
$table->integer('sequence', false, true);
$table->text('comment')->nullable();
$table->foreign('link_type_id')->references('id')->on('link_types')->onDelete('cascade');
$table->foreign('source_id')->references('id')->on('transaction_journals')->onDelete('cascade');

View File

@@ -27,28 +27,28 @@ class LinkTypeSeeder extends Seeder
$link = new LinkType;
$link->name = 'Related';
$link->inward = 'relates to';
$link->outward = 'is related to';
$link->outward = 'relates to';
$link->editable = false;
$link->save();
$link = new LinkType;
$link->name = 'Refund';
$link->inward = '(partially) refunds';
$link->outward = 'is (partially) refunded by';
$link->inward = 'is (partially) refunded by';
$link->outward = '(partially) refunds';
$link->editable = false;
$link->save();
$link = new LinkType;
$link->name = 'Paid';
$link->inward = '(partially) pays for';
$link->outward = 'is (partially) paid for by';
$link->inward = 'is (partially) paid for by';
$link->outward = '(partially) pays for';
$link->editable = false;
$link->save();
$link = new LinkType;
$link->name = 'Reimbursement';
$link->inward = '(partially) reimburses';
$link->outward = 'is (partially) reimbursed by';
$link->inward = 'is (partially) reimbursed by';
$link->outward = '(partially) reimburses';
$link->editable = false;
$link->save();