Skip to content

Commit

Permalink
fix: datetime and audit report fix
Browse files Browse the repository at this point in the history
  • Loading branch information
anhilmy committed Jul 5, 2024
1 parent a047803 commit 39fefb0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion inn/inn_hotels/doctype/inn_shift/inn_shift.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from datetime import datetime, timedelta

import frappe
from frappe.utils import now
from frappe.model.document import Document

class InnShift(Document):
Expand Down Expand Up @@ -478,7 +479,7 @@ def populate_cr_refund(shift_id):
@frappe.whitelist()
def close_shift(shift_id):
doc = frappe.get_doc('Inn Shift', shift_id)
doc.time_out = datetime.now() + timedelta(hours=7)
doc.time_out = now()
doc.username = frappe.session.user
doc.status = 'Closed'
doc.save()
Expand Down
4 changes: 2 additions & 2 deletions inn/inn_hotels/report/audit_report/audit_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ def get_data_detail(start_date, is_show_mode_payment):
left join `tabInn Folio` as `if`
on if.reservation_id = ir.name
where
(ir.status = 'In House' and ir.expected_arrival = '{start_date}') or
(ir.status = 'Finish' and ir.expected_arrival <= '{start_date}' and ir.expected_departure > '{start_date} ')
(ir.status = 'In House' and ir.expected_arrival < '{start_date}') or
(ir.status = 'Finish' and ir.expected_arrival < '{start_date}' and ir.expected_departure >= '{start_date} ')
"""

reservation = frappe.db.sql(query=query, as_dict=1)
Expand Down

0 comments on commit 39fefb0

Please sign in to comment.