feat: Receivable and payable aging summary financial statement.

This commit is contained in:
Ahmed Bouhuolia
2020-06-11 22:05:34 +02:00
parent 55a4319827
commit 4d1dd14f8d
36 changed files with 1435 additions and 195 deletions

View File

@@ -3,6 +3,7 @@ exports.up = (knex) => {
return knex.schema.createTable('account_types', (table) => {
table.increments();
table.string('name');
table.string('key');
table.string('normal');
table.string('root_type');
table.boolean('balance_sheet');

View File

@@ -7,6 +7,7 @@ exports.up = function (knex) {
table.integer('resource_id').unsigned().references('id').inTable('resources');
table.boolean('favourite');
table.string('roles_logic_expression');
table.timestamps();
}).raw('ALTER TABLE `VIEWS` AUTO_INCREMENT = 1000').then(() => {
return knex.seed.run({
specific: 'seed_views.js',

View File

@@ -8,6 +8,8 @@ exports.up = function(knex) {
table.string('reference_type');
table.integer('reference_id');
table.integer('account_id').unsigned();
table.string('contact_type').nullable();
table.integer('contact_id').unsigned().nullable();
table.string('note');
table.boolean('draft').defaultTo(false);
table.integer('user_id').unsigned();

View File

@@ -4,6 +4,7 @@ exports.up = function(knex) {
table.increments();
table.string('currency_name');
table.string('currency_code', 4);
table.timestamps();
}).raw('ALTER TABLE `CURRENCIES` AUTO_INCREMENT = 1000');
};

View File

@@ -5,6 +5,7 @@ exports.up = function(knex) {
table.string('currency_code', 4);
table.decimal('exchange_rate');
table.date('date');
table.timestamps();
}).raw('ALTER TABLE `EXCHANGE_RATES` AUTO_INCREMENT = 1000');
};

View File

@@ -34,6 +34,7 @@ exports.up = function(knex) {
table.text('note');
table.boolean('active').defaultTo(true);
table.timestamps();
});
};

View File

@@ -34,6 +34,8 @@ exports.up = function(knex) {
table.text('note');
table.boolean('active').defaultTo(true);
table.timestamps();
});
};

View File

@@ -8,6 +8,7 @@ exports.seed = (knex) => {
{
id: 1,
name: 'Fixed Asset',
key: 'fixed_asset',
normal: 'debit',
root_type: 'asset',
balance_sheet: true,
@@ -16,6 +17,7 @@ exports.seed = (knex) => {
{
id: 2,
name: 'Current Asset',
key: 'current_asset',
normal: 'debit',
root_type: 'asset',
balance_sheet: true,
@@ -24,6 +26,7 @@ exports.seed = (knex) => {
{
id: 3,
name: 'Long Term Liability',
key: 'long_term_liability',
normal: 'credit',
root_type: 'liability',
balance_sheet: false,
@@ -32,6 +35,7 @@ exports.seed = (knex) => {
{
id: 4,
name: 'Current Liability',
key: 'current_liability',
normal: 'credit',
root_type: 'liability',
balance_sheet: false,
@@ -40,6 +44,7 @@ exports.seed = (knex) => {
{
id: 5,
name: 'Equity',
key: 'equity',
normal: 'credit',
root_type: 'equity',
balance_sheet: true,
@@ -48,6 +53,7 @@ exports.seed = (knex) => {
{
id: 6,
name: 'Expense',
key: 'expense',
normal: 'debit',
root_type: 'expense',
balance_sheet: false,
@@ -56,6 +62,7 @@ exports.seed = (knex) => {
{
id: 7,
name: 'Income',
key: 'income',
normal: 'credit',
root_type: 'income',
balance_sheet: false,
@@ -64,6 +71,7 @@ exports.seed = (knex) => {
{
id: 8,
name: 'Accounts Receivable',
key: 'accounts_receivable',
normal: 'debit',
root_type: 'asset',
balance_sheet: true,
@@ -72,6 +80,7 @@ exports.seed = (knex) => {
{
id: 9,
name: 'Accounts Payable',
key: 'accounts_payable',
normal: 'credit',
root_type: 'liability',
balance_sheet: true,

View File

@@ -103,7 +103,29 @@ exports.seed = (knex) => {
active: 1,
index: 1,
predefined: 1,
}
},
{
id: 10,
name: 'Accounts Receivable',
account_type_id: 8,
parent_account_id: null,
code: '1000',
description: '',
active: 1,
index: 1,
predefined: 1,
},
{
id: 11,
name: 'Accounts Payable',
account_type_id: 9,
parent_account_id: null,
code: '1000',
description: '',
active: 1,
index: 1,
predefined: 1,
},
]);
});
};