mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: fix a bunch of bugs.
This commit is contained in:
@@ -9,6 +9,7 @@ exports.up = function (knex) {
|
||||
table.text('description');
|
||||
table.boolean('active').defaultTo(true);
|
||||
table.integer('index').unsigned();
|
||||
table.boolean('predefined').defaultTo(false);
|
||||
table.timestamps();
|
||||
}).then(() => {
|
||||
return knex.seed.run({
|
||||
|
||||
@@ -4,6 +4,7 @@ exports.up = (knex) => {
|
||||
table.increments();
|
||||
table.string('name');
|
||||
table.string('normal');
|
||||
table.string('root_type');
|
||||
table.boolean('balance_sheet');
|
||||
table.boolean('income_sheet');
|
||||
}).then(() => {
|
||||
|
||||
@@ -9,6 +9,7 @@ exports.seed = (knex) => {
|
||||
id: 1,
|
||||
name: 'Fixed Asset',
|
||||
normal: 'debit',
|
||||
root_type: 'asset',
|
||||
balance_sheet: true,
|
||||
income_sheet: false,
|
||||
},
|
||||
@@ -16,6 +17,7 @@ exports.seed = (knex) => {
|
||||
id: 2,
|
||||
name: 'Current Asset',
|
||||
normal: 'debit',
|
||||
root_type: 'asset',
|
||||
balance_sheet: true,
|
||||
income_sheet: false,
|
||||
},
|
||||
@@ -23,6 +25,7 @@ exports.seed = (knex) => {
|
||||
id: 3,
|
||||
name: 'Long Term Liability',
|
||||
normal: 'credit',
|
||||
root_type: 'liability',
|
||||
balance_sheet: false,
|
||||
income_sheet: true,
|
||||
},
|
||||
@@ -30,6 +33,7 @@ exports.seed = (knex) => {
|
||||
id: 4,
|
||||
name: 'Current Liability',
|
||||
normal: 'credit',
|
||||
root_type: 'liability',
|
||||
balance_sheet: false,
|
||||
income_sheet: true,
|
||||
},
|
||||
@@ -37,6 +41,7 @@ exports.seed = (knex) => {
|
||||
id: 5,
|
||||
name: 'Equity',
|
||||
normal: 'credit',
|
||||
root_type: 'equity',
|
||||
balance_sheet: false,
|
||||
income_sheet: true,
|
||||
},
|
||||
@@ -44,6 +49,7 @@ exports.seed = (knex) => {
|
||||
id: 6,
|
||||
name: 'Expense',
|
||||
normal: 'debit',
|
||||
root_type: 'expense',
|
||||
balance_sheet: false,
|
||||
income_sheet: true,
|
||||
},
|
||||
@@ -51,6 +57,7 @@ exports.seed = (knex) => {
|
||||
id: 7,
|
||||
name: 'Income',
|
||||
normal: 'credit',
|
||||
root_type: 'income',
|
||||
balance_sheet: false,
|
||||
income_sheet: true,
|
||||
},
|
||||
@@ -58,6 +65,7 @@ exports.seed = (knex) => {
|
||||
id: 8,
|
||||
name: 'Accounts Receivable',
|
||||
normal: 'debit',
|
||||
root_type: 'asset',
|
||||
balance_sheet: true,
|
||||
income_sheet: false,
|
||||
},
|
||||
@@ -65,6 +73,7 @@ exports.seed = (knex) => {
|
||||
id: 9,
|
||||
name: 'Accounts Payable',
|
||||
normal: 'credit',
|
||||
root_type: 'liability',
|
||||
balance_sheet: true,
|
||||
income_sheet: false,
|
||||
},
|
||||
|
||||
@@ -10,20 +10,22 @@ exports.seed = (knex) => {
|
||||
name: 'Petty Cash',
|
||||
account_type_id: 2,
|
||||
parent_account_id: null,
|
||||
code: '10000',
|
||||
code: '1000',
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Bank',
|
||||
account_type_id: 2,
|
||||
parent_account_id: null,
|
||||
code: '20000',
|
||||
code: '2000',
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
@@ -34,6 +36,7 @@ exports.seed = (knex) => {
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
@@ -44,6 +47,7 @@ exports.seed = (knex) => {
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
@@ -54,6 +58,7 @@ exports.seed = (knex) => {
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
@@ -64,6 +69,7 @@ exports.seed = (knex) => {
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
@@ -74,6 +80,7 @@ exports.seed = (knex) => {
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
@@ -84,6 +91,7 @@ exports.seed = (knex) => {
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
@@ -94,6 +102,7 @@ exports.seed = (knex) => {
|
||||
description: '',
|
||||
active: 1,
|
||||
index: 1,
|
||||
predefined: 1,
|
||||
}
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -5,10 +5,19 @@ exports.seed = function(knex) {
|
||||
.then(() => {
|
||||
// Inserts seed entries
|
||||
return knex('resource_fields').insert([
|
||||
{id: 1, label_name: 'Name', key: 'name', data_type: '', active: 1, predefined: 1} ,
|
||||
{id: 2, label_name: 'Code', key: 'code', data_type: '', active: 1, predefined: 1 },
|
||||
{id: 3, label_name: 'Account Type', key: 'account_type_id', data_type: '', active: 1, predefined: 1},
|
||||
{id: 4, label_name: 'Description', key: 'description', data_type: '', active: 1, predefined: 1},
|
||||
{ id: 1, label_name: 'Name', key: 'name', data_type: '', active: 1, predefined: 1 },
|
||||
{ id: 2, label_name: 'Code', key: 'code', data_type: '', active: 1, predefined: 1 },
|
||||
{ id: 3, label_name: 'Account Type', key: 'account_type_id', data_type: '', active: 1, predefined: 1 },
|
||||
{ id: 4, label_name: 'Description', key: 'description', data_type: '', active: 1, predefined: 1 },
|
||||
{ id: 5, label_name: 'Account Normal', key: 'normal', data_type: 'string', active: 1, predefined: 1 },
|
||||
{
|
||||
id: 6,
|
||||
label_name: 'Root Account Type',
|
||||
key: 'root_account_type',
|
||||
data_type: 'string',
|
||||
active: 1,
|
||||
predefined: 1,
|
||||
},
|
||||
]);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -40,10 +40,19 @@ exports.seed = (knex) => {
|
||||
predefined: 1,
|
||||
columnable: true,
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
resource_id: 1,
|
||||
label_name: 'Root type',
|
||||
data_type: 'textbox',
|
||||
key: 'root_type',
|
||||
predefined: 1,
|
||||
columnable: true,
|
||||
},
|
||||
|
||||
// Expenses
|
||||
{
|
||||
id: 6,
|
||||
id: 7,
|
||||
resource_id: 3,
|
||||
label_name: 'Date',
|
||||
data_type: 'date',
|
||||
@@ -51,7 +60,7 @@ exports.seed = (knex) => {
|
||||
columnable: true,
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
id: 8,
|
||||
resource_id: 3,
|
||||
label_name: 'Expense Account',
|
||||
data_type: 'options',
|
||||
@@ -59,7 +68,7 @@ exports.seed = (knex) => {
|
||||
columnable: true,
|
||||
},
|
||||
{
|
||||
id: 8,
|
||||
id: 9,
|
||||
resource_id: 3,
|
||||
label_name: 'Payment Account',
|
||||
data_type: 'options',
|
||||
@@ -67,7 +76,7 @@ exports.seed = (knex) => {
|
||||
columnable: true,
|
||||
},
|
||||
{
|
||||
id: 9,
|
||||
id: 10,
|
||||
resource_id: 3,
|
||||
label_name: 'Amount',
|
||||
data_type: 'number',
|
||||
@@ -77,7 +86,7 @@ exports.seed = (knex) => {
|
||||
|
||||
// Items
|
||||
{
|
||||
id: 10,
|
||||
id: 11,
|
||||
resource_id: 2,
|
||||
label_name: 'Name',
|
||||
key: 'name',
|
||||
@@ -86,7 +95,7 @@ exports.seed = (knex) => {
|
||||
columnable: true,
|
||||
},
|
||||
{
|
||||
id: 11,
|
||||
id: 12,
|
||||
resource_id: 2,
|
||||
label_name: 'Type',
|
||||
key: 'type',
|
||||
|
||||
@@ -5,11 +5,11 @@ exports.seed = (knex) => {
|
||||
.then(() => {
|
||||
// Inserts seed entries
|
||||
return knex('views').insert([
|
||||
{id: 1, name: 'Assets', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{id: 2, name: 'Liabilities', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{id: 3, name: 'Equity', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{id: 4, name: 'Income', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{id: 5, name: 'Expenses', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{ id: 1, name: 'Assets', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{ id: 2, name: 'Liabilities', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{ id: 3, name: 'Equity', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{ id: 4, name: 'Income', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
{ id: 5, name: 'Expenses', roles_logic_expression: '1', resource_id: 1, predefined: true },
|
||||
]);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -5,11 +5,11 @@ exports.seed = (knex) => {
|
||||
.then(() => {
|
||||
// Inserts seed entries
|
||||
return knex('view_roles').insert([
|
||||
{id: 1, field_id: 3, comparator: 'equals', value: '', view_id: 1},
|
||||
{id: 2, field_id: 3, comparator: 'equals', value: '', view_id: 2},
|
||||
{id: 3, field_id: 3, comparator: 'equals', value: '', view_id: 3},
|
||||
{id: 4, field_id: 3, comparator: 'equals', value: '', view_id: 4},
|
||||
{id: 5, field_id: 3, comparator: 'equals', value: '', view_id: 5},
|
||||
{ id: 1, field_id: 6, comparator: 'equals', value: 'asset', view_id: 1 },
|
||||
{ id: 2, field_id: 6, comparator: 'equals', value: 'liability', view_id: 2 },
|
||||
{ id: 3, field_id: 6, comparator: 'equals', value: 'equity', view_id: 3 },
|
||||
{ id: 4, field_id: 6, comparator: 'equals', value: 'income', view_id: 4 },
|
||||
{ id: 5, field_id: 6, comparator: 'equals', value: 'expense', view_id: 5 },
|
||||
]);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user