WIP Financial accounting module.

This commit is contained in:
Ahmed Bouhuolia
2020-01-25 23:34:08 +02:00
parent 488709088b
commit 77c67cc4cb
26 changed files with 1414 additions and 354 deletions

View File

@@ -181,6 +181,17 @@ factory.define('resource_field', 'resource_fields', async () => {
};
});
factory.define('resource_custom_field_metadata', 'resource_custom_fields_metadata', async () => {
const resource = await factory.create('resource');
return {
resource_id: resource.id,
resource_item_id: 1,
key: faker.lorem.words(),
value: faker.lorem.words(),
};
});
factory.define('view_role', 'view_roles', async () => {
const view = await factory.create('view');
const field = await factory.create('resource_field');

View File

@@ -3,7 +3,7 @@ exports.up = function (knex) {
return knex.schema.createTable('items', (table) => {
table.increments();
table.string('name');
table.integer('type_id').unsigned();
table.string('type');
table.decimal('cost_price').unsigned();
table.decimal('sell_price').unsigned();
table.string('currency_code', 3);

View File

@@ -10,6 +10,7 @@ exports.up = function (knex) {
table.boolean('active');
table.boolean('predefined');
table.boolean('columnable');
table.integer('index');
table.json('options');
table.integer('resource_id').unsigned().references('id').inTable('resources');
});

View File

@@ -9,6 +9,7 @@ exports.up = function(knex) {
table.integer('reference_id');
table.integer('account_id').unsigned().references('id').inTable('accounts');
table.string('note');
table.boolean('draft').defaultTo(false);
table.integer('user_id').unsigned().references('id').inTable('users');
table.date('date');
table.timestamps();

View File

@@ -9,6 +9,7 @@ exports.up = function(knex) {
table.integer('expense_account_id').unsigned().references('id').inTable('accounts');
table.integer('payment_account_id').unsigned().references('id').inTable('accounts');
table.string('reference');
table.boolean('published').defaultTo(false);
table.integer('user_id').unsigned().references('id').inTable('users');
table.date('date');
// table.timestamps();

View File

@@ -0,0 +1,14 @@
exports.up = function(knex) {
return knex.schema.createTable('resource_custom_fields_metadata', (table) => {
table.increments();
table.integer('resource_id').unsigned().references('id').inTable('resources');
table.integer('resource_item_id').unsigned();
table.string('key');
table.string('value');
})
};
exports.down = function(knex) {
return knex.schema.dropTableIfExists('resource_custom_fields_metadata');
};