mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: inventory adjustment service.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
|
||||
exports.up = function(knex) {
|
||||
return knex.schema.createTable('inventory_adjustments', table => {
|
||||
table.increments();
|
||||
table.date('date').index();
|
||||
table.string('type').index();
|
||||
table.string('reason');
|
||||
table.string('reference_no').index();
|
||||
table.string('description');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function(knex) {
|
||||
return knex.schema.dropTableIfExists('inventory_adjustments');
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
exports.up = function(knex) {
|
||||
return knex.schema.createTable('inventory_adjustments_entries', table => {
|
||||
table.increments();
|
||||
table.integer('adjustment_id').unsigned().index().references('id').inTable('inventory_adjustments');
|
||||
table.integer('index').unsigned();
|
||||
table.integer('item_id').unsigned().index().references('id').inTable('items');
|
||||
table.decimal('new_quantity').unsigned();
|
||||
table.decimal('new_cost').unsigned();
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = function(knex) {
|
||||
return knex.schema.dropTableIfExists('inventory_adjustments_entries');
|
||||
};
|
||||
Reference in New Issue
Block a user