fix: Graph fetch relations with sales & purchases models.

feat: Inventory tracker algorithm lots with FIFO or LIFO cost method.
This commit is contained in:
Ahmed Bouhuolia
2020-08-11 01:00:33 +02:00
parent 8d4b3f1ab3
commit 42569c89e4
25 changed files with 526 additions and 93 deletions

View File

@@ -3,16 +3,16 @@ exports.up = function(knex) {
return knex.schema.createTable('inventory_transactions', table => {
table.increments('id');
table.date('date');
table.string('direction');
table.integer('item_id');
table.integer('quantity');
table.decimal('rate', 13, 3);
table.integer('remaining');
table.string('transaction_type');
table.integer('transaction_id');
table.integer('inventory_transaction_id');
table.timestamps();
});
};

View File

@@ -0,0 +1,20 @@
exports.up = function(knex) {
return knex.schema.createTable('inventory_cost_lot_tracker', table => {
table.increments();
table.date('date');
table.string('direction');
table.integer('item_id');
table.decimal('rate', 13, 3);
table.integer('remaining');
table.string('transaction_type');
table.integer('transaction_id');
});
};
exports.down = function(knex) {
return knex.schema.dropTableIfExists('inventory_cost_lot_tracker');
};