Skip to content

Commit

Permalink
fix: failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayitzme committed Sep 18, 2023
1 parent 926db6e commit 972969b
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions backend/database/bespoke.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
import { ModelNameEnum } from '../../models/types';
import DatabaseCore from './core';
import { BespokeFunction } from './types';
import { DateTime } from 'luxon';
import { DocItem, ReturnDocItem } from 'models/inventory/types';
import { safeParseFloat } from 'utils/index';
import { Money } from 'pesa';
Expand Down Expand Up @@ -382,11 +383,9 @@ export class BespokeQueries {
await db.knex!(ModelNameEnum.SalesInvoice)
.select('name')
.where('isPOS', true)
.andWhereRaw('datetime(date) > datetime(?)', [
new Date(fromDate.setHours(0, 0, 0)).toISOString(),
])
.andWhereRaw('datetime(date) < datetime(?)', [
new Date(toDate.setHours(0, 0, 0)).toISOString(),
.andWhereBetween('date', [
DateTime.fromJSDate(fromDate).toISODate(),
DateTime.fromJSDate(toDate).toISODate(),
])
).map((row: { name: string }) => row.name);

Expand Down

0 comments on commit 972969b

Please sign in to comment.