mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 20:30:33 +00:00
WIP: Allocate landed cost.
This commit is contained in:
@@ -1,19 +1,31 @@
|
||||
|
||||
exports.up = function(knex) {
|
||||
exports.up = function (knex) {
|
||||
return knex.schema.createTable('items_entries', (table) => {
|
||||
table.increments();
|
||||
table.string('reference_type').index();
|
||||
table.string('reference_id').index();
|
||||
|
||||
table.integer('index').unsigned();
|
||||
table.integer('item_id').unsigned().index().references('id').inTable('items');
|
||||
table
|
||||
.integer('item_id')
|
||||
.unsigned()
|
||||
.index()
|
||||
.references('id')
|
||||
.inTable('items');
|
||||
table.text('description');
|
||||
table.integer('discount').unsigned();
|
||||
table.integer('quantity').unsigned();
|
||||
table.integer('rate').unsigned();
|
||||
|
||||
table.integer('sell_account_id').unsigned().references('id').inTable('accounts');
|
||||
table.integer('cost_account_id').unsigned().references('id').inTable('accounts');
|
||||
table
|
||||
.integer('sell_account_id')
|
||||
.unsigned()
|
||||
.references('id')
|
||||
.inTable('accounts');
|
||||
table
|
||||
.integer('cost_account_id')
|
||||
.unsigned()
|
||||
.references('id')
|
||||
.inTable('accounts');
|
||||
|
||||
table.boolean('landed_cost').defaultTo(false);
|
||||
table.decimal('allocated_cost_amount', 13, 3);
|
||||
@@ -21,6 +33,6 @@ exports.up = function(knex) {
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function(knex) {
|
||||
exports.down = function (knex) {
|
||||
return knex.schema.dropTableIfExists('items_entries');
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user