mirror of
https://github.com/frappe/books.git
synced 2024-11-09 23:30:56 +00:00
fix: failing test
This commit is contained in:
parent
81be57be32
commit
819d88f494
@ -8,6 +8,7 @@ import {
|
|||||||
import { ModelNameEnum } from '../../models/types';
|
import { ModelNameEnum } from '../../models/types';
|
||||||
import DatabaseCore from './core';
|
import DatabaseCore from './core';
|
||||||
import { BespokeFunction } from './types';
|
import { BespokeFunction } from './types';
|
||||||
|
import { DateTime } from 'luxon';
|
||||||
import { DocItem, ReturnDocItem } from 'models/inventory/types';
|
import { DocItem, ReturnDocItem } from 'models/inventory/types';
|
||||||
import { safeParseFloat } from 'utils/index';
|
import { safeParseFloat } from 'utils/index';
|
||||||
import { Money } from 'pesa';
|
import { Money } from 'pesa';
|
||||||
@ -401,11 +402,9 @@ export class BespokeQueries {
|
|||||||
await db.knex!(ModelNameEnum.SalesInvoice)
|
await db.knex!(ModelNameEnum.SalesInvoice)
|
||||||
.select('name')
|
.select('name')
|
||||||
.where('isPOS', true)
|
.where('isPOS', true)
|
||||||
.andWhereRaw('datetime(date) > datetime(?)', [
|
.andWhereBetween('date', [
|
||||||
new Date(fromDate.setHours(0, 0, 0)).toISOString(),
|
DateTime.fromJSDate(fromDate).toISODate(),
|
||||||
])
|
DateTime.fromJSDate(toDate).toISODate(),
|
||||||
.andWhereRaw('datetime(date) < datetime(?)', [
|
|
||||||
new Date(toDate.setHours(0, 0, 0)).toISOString(),
|
|
||||||
])
|
])
|
||||||
).map((row: { name: string }) => row.name);
|
).map((row: { name: string }) => row.name);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user