feat: Manual journals.

This commit is contained in:
Ahmed Bouhuolia
2020-04-05 19:20:47 +02:00
parent b2d1a09612
commit 2d904601fa
6 changed files with 127 additions and 5 deletions

View File

@@ -66,9 +66,11 @@ factory.define('manual_journal', 'manual_journals', async () => {
const user = await factory.create('user');
return {
reference: faker.random.number(),
journal_number: faker.random.number(),
transaction_type: '',
amount: faker.random.number(),
// date: faker.random,
date: faker.date.future,
status: 1,
user_id: user.id,
};
});

View File

@@ -2,10 +2,11 @@
exports.up = function(knex) {
return knex.schema.createTable('manual_journals', (table) => {
table.increments();
table.string('reference');
table.string('journal_number');
table.string('transaction_type');
table.decimal('amount');
table.date('date');
table.boolean('status').defaultTo(false);
table.string('note');
table.integer('user_id').unsigned();
table.timestamps();

View File

@@ -8,6 +8,7 @@ exports.seed = (knex) => {
{ id: 1, name: 'accounts' },
{ id: 2, name: 'items' },
{ id: 3, name: 'expenses' },
{ id: 4, name: 'manual_journals' },
]);
});
};