feat: add discount to sale and purchase transactions

This commit is contained in:
Ahmed Bouhuolia
2024-11-28 10:12:48 +02:00
parent 09b98664c5
commit aa4aaeb612
3 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.alterTable('sales_invoices', (table) => {
table.decimal('discount', 10, 2).nullable().after('credited_amount');
table.string('discount_type').nullable().after('discount');
table.decimal('adjustments', 10, 2).nullable().after('discount_type');
});
};
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.alterTable('sale_invoices', (table) => {
table.dropColumn('discount');
table.dropColumn('discount_type');
table.dropColumn('adjustments');
});
};