feat(sales): currency code associated from invoice customer.

feat(purchases): currency code associated from vendor customer.
This commit is contained in:
a.bouhuolia
2021-03-08 09:47:04 +02:00
parent 6ec4ee4f0f
commit 3a3d881f67
26 changed files with 292 additions and 196 deletions

View File

@@ -4,6 +4,7 @@ exports.up = function(knex) {
return knex.schema.createTable('sales_estimates', (table) => {
table.increments();
table.decimal('amount', 13, 3);
table.string('currency_code', 3);
table.integer('customer_id').unsigned().index().references('id').inTable('contacts');
table.date('estimate_date').index();
table.date('expiration_date').index();

View File

@@ -3,6 +3,7 @@ exports.up = function(knex) {
return knex.schema.createTable('sales_receipts', table => {
table.increments();
table.decimal('amount', 13, 3);
table.string('currency_code', 3);
table.integer('deposit_account_id').unsigned().index().references('id').inTable('accounts');
table.integer('customer_id').unsigned().index().references('id').inTable('contacts');
table.date('receipt_date').index();

View File

@@ -13,6 +13,7 @@ exports.up = function(knex) {
table.decimal('balance', 13, 3);
table.decimal('payment_amount', 13, 3);
table.string('currency_code', 3);
table.string('inv_lot_number').index();

View File

@@ -6,6 +6,7 @@ exports.up = function(knex) {
table.integer('customer_id').unsigned().index().references('id').inTable('contacts');
table.date('payment_date').index();
table.decimal('amount', 13, 3).defaultTo(0);
table.string('currency_code', 3);
table.string('reference_no').index();
table.integer('deposit_account_id').unsigned().references('id').inTable('accounts');
table.string('payment_receive_no').nullable();

View File

@@ -10,6 +10,7 @@ exports.up = function(knex) {
table.string('status').index();
table.text('note');
table.decimal('amount', 13, 3).defaultTo(0);
table.string('currency_code');
table.decimal('payment_amount', 13, 3).defaultTo(0);
table.string('inv_lot_number').index();
table.date('opened_at').index();

View File

@@ -4,6 +4,7 @@ exports.up = function(knex) {
table.increments();
table.integer('vendor_id').unsigned().index().references('id').inTable('contacts');
table.decimal('amount', 13, 3).defaultTo(0);
table.string('currency_code');
table.integer('payment_account_id').unsigned().references('id').inTable('accounts');
table.string('payment_number').nullable().index();
table.date('payment_date').index();