Skip to content

Commit

Permalink
fix: add on hold fixes to query builder
Browse files Browse the repository at this point in the history
  • Loading branch information
agritheory committed Feb 28, 2023
1 parent 8b4073e commit a1e3114
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion check_run/check_run/doctype/check_run/check_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# For license information, please see license.txt

from __future__ import unicode_literals
import datetime
import json
from itertools import groupby, zip_longest
from io import StringIO
Expand Down Expand Up @@ -366,8 +367,8 @@ def get_entries(doc):
.where(purchase_invoices.company == company)
.where(purchase_invoices.docstatus == 1)
.where(purchase_invoices.credit_to == pay_to_account)
.where(purchase_invoices.status != 'On Hold')
.where(purchase_invoices.due_date <= end_date)
.where(Coalesce(purchase_invoices.release_date, datetime.date(1900, 1, 1)) <= end_date)
)

# Build expense claims query
Expand Down
2 changes: 1 addition & 1 deletion check_run/test_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def create_invoices(settings):
'qty': 1,
})
pi.on_hold =1
pi.release_date = settings.day + datetime.timedelta(days=30)
pi.release_date = settings.day + datetime.timedelta(days=60)
pi.hold_comment = 'Testing for on hold invoices'
pi.validate_release_date = types.MethodType(validate_release_date, pi) # allow date to be backdated for testing
pi.save()
Expand Down

0 comments on commit a1e3114

Please sign in to comment.