fix: writing journal entries of manual journal.

This commit is contained in:
a.bouhuolia
2021-01-03 19:39:17 +02:00
parent a2284945f1
commit ccf4fa55d9
13 changed files with 715 additions and 361 deletions

View File

@@ -7,8 +7,8 @@ exports.up = function(knex) {
table.string('journal_type').index();
table.decimal('amount', 13, 3);
table.date('date').index();
table.boolean('status').defaultTo(false).index();
table.string('description');
table.date('published_at').index();
table.string('attachment_file');
table.integer('user_id').unsigned().index();
table.timestamps();

View File

@@ -0,0 +1,18 @@
exports.up = function(knex) {
return knex.schema.createTable('manual_journals_entries', (table) => {
table.increments();
table.decimal('credit', 13, 3);
table.decimal('debit', 13, 3);
table.integer('index').unsigned();
table.integer('account_id').unsigned().index().references('id').inTable('accounts');
table.string('contact_type').nullable().index();
table.integer('contact_id').unsigned().nullable().index();
table.string('note');
table.integer('manual_journal_id').unsigned().index().references('id').inTable('manual_journals');
}).raw('ALTER TABLE `MANUAL_JOURNALS_ENTRIES` AUTO_INCREMENT = 1000');
};
exports.down = function(knex) {
return knex.schema.dropTableIfExists('manual_journals_entries');
};