fix: sale receipt date formating.

This commit is contained in:
Ahmed Bouhuolia
2020-10-26 15:09:32 +02:00
parent 40fa6aa71f
commit d68e3f41ea
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ exports.up = function(knex) {
table.date('receipt_date').index(); table.date('receipt_date').index();
table.string('receipt_number'); table.string('receipt_number');
table.string('reference_no'); table.string('reference_no');
table.string('email_send_to'); table.string('send_to_email');
table.text('receipt_message'); table.text('receipt_message');
table.text('statement'); table.text('statement');
table.timestamps(); table.timestamps();

View File

@@ -114,7 +114,7 @@ export default class SalesReceiptService {
const amount = sumBy(saleReceiptDTO.entries, e => ItemEntry.calcAmount(e)); const amount = sumBy(saleReceiptDTO.entries, e => ItemEntry.calcAmount(e));
const saleReceiptObj = { const saleReceiptObj = {
amount, amount,
...formatDateFields(saleReceiptDTO, ['receipt_date']) ...formatDateFields(saleReceiptDTO, ['receiptDate'])
}; };
// Validate receipt deposit account existance and type. // Validate receipt deposit account existance and type.
@@ -159,7 +159,7 @@ export default class SalesReceiptService {
const amount = sumBy(saleReceiptDTO.entries, e => ItemEntry.calcAmount(e)); const amount = sumBy(saleReceiptDTO.entries, e => ItemEntry.calcAmount(e));
const saleReceiptObj = { const saleReceiptObj = {
amount, amount,
...formatDateFields(saleReceiptDTO, ['receipt_date']) ...formatDateFields(saleReceiptDTO, ['receiptDate'])
}; };
// Retrieve sale receipt or throw not found service error. // Retrieve sale receipt or throw not found service error.
const oldSaleReceipt = await this.getSaleReceiptOrThrowError(tenantId, saleReceiptId); const oldSaleReceipt = await this.getSaleReceiptOrThrowError(tenantId, saleReceiptId);