feat: inventory adjustment service.

This commit is contained in:
a.bouhuolia
2021-01-09 21:56:09 +02:00
parent 30a7552b22
commit 4d9ff02b50
10 changed files with 498 additions and 1 deletions

View File

@@ -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');
};

View File

@@ -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');
};