mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
@@ -140,13 +140,13 @@ def gl_entry_details(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
and ifnull(gle.%(account_type)s, 0) > 0
|
and ifnull(gle.%(account_type)s, 0) > 0
|
||||||
and (select ifnull(abs(sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))), 0)
|
and (select ifnull(abs(sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))), 0)
|
||||||
from `tabGL Entry`
|
from `tabGL Entry`
|
||||||
where against_voucher_type = '%(dt)s'
|
where account = '%(acc)s'
|
||||||
|
and against_voucher_type = '%(dt)s'
|
||||||
and against_voucher = gle.voucher_no
|
and against_voucher = gle.voucher_no
|
||||||
and voucher_no != gle.voucher_no)
|
and voucher_no != gle.voucher_no)
|
||||||
!= abs(ifnull(gle.debit, 0) - ifnull(gle.credit, 0)
|
!= abs(ifnull(gle.debit, 0) - ifnull(gle.credit, 0))
|
||||||
)
|
and if(gle.voucher_type='Sales Invoice', ifnull((select is_pos from `tabSales Invoice`
|
||||||
and if(gle.voucher_type='Sales Invoice', (select is_pos from `tabSales Invoice`
|
where name=gle.voucher_no), 0), 0)=0
|
||||||
where name=gle.voucher_no), 0)=0
|
|
||||||
%(mcond)s
|
%(mcond)s
|
||||||
ORDER BY gle.posting_date desc, gle.voucher_no desc
|
ORDER BY gle.posting_date desc, gle.voucher_no desc
|
||||||
limit %(start)s, %(page_len)s""" % {
|
limit %(start)s, %(page_len)s""" % {
|
||||||
|
|||||||
@@ -73,6 +73,11 @@ def get_conditions(filters):
|
|||||||
if filters.get("voucher_no"):
|
if filters.get("voucher_no"):
|
||||||
conditions.append("voucher_no=%(voucher_no)s")
|
conditions.append("voucher_no=%(voucher_no)s")
|
||||||
|
|
||||||
|
|
||||||
|
from webnotes.widgets.reportview import build_match_conditions
|
||||||
|
match_conditions = build_match_conditions("GL Entry")
|
||||||
|
if match_conditions: conditions.append(match_conditions)
|
||||||
|
|
||||||
return "and {}".format(" and ".join(conditions)) if conditions else ""
|
return "and {}".format(" and ".join(conditions)) if conditions else ""
|
||||||
|
|
||||||
def get_data_with_opening_closing(filters, account_details, gl_entries):
|
def get_data_with_opening_closing(filters, account_details, gl_entries):
|
||||||
|
|||||||
@@ -54,6 +54,10 @@ def execute_daily():
|
|||||||
from setup.doctype.email_digest.email_digest import send
|
from setup.doctype.email_digest.email_digest import send
|
||||||
run_fn(send)
|
run_fn(send)
|
||||||
|
|
||||||
|
# auto close support tickets
|
||||||
|
from support.doctype.support_ticket.support_ticket import auto_close_tickets
|
||||||
|
run_fn(auto_close_tickets)
|
||||||
|
|
||||||
def execute_weekly():
|
def execute_weekly():
|
||||||
from setup.doctype.backup_manager.backup_manager import take_backups_weekly
|
from setup.doctype.backup_manager.backup_manager import take_backups_weekly
|
||||||
run_fn(take_backups_weekly)
|
run_fn(take_backups_weekly)
|
||||||
|
|||||||
@@ -52,11 +52,6 @@ Original Query:
|
|||||||
subject = '['+cstr(d.name)+'] ' + cstr(d.subject), \
|
subject = '['+cstr(d.name)+'] ' + cstr(d.subject), \
|
||||||
msg = cstr(response))
|
msg = cstr(response))
|
||||||
|
|
||||||
def auto_close_tickets(self):
|
|
||||||
webnotes.conn.sql("""update `tabSupport Ticket` set status = 'Closed'
|
|
||||||
where status = 'Replied'
|
|
||||||
and date_sub(curdate(),interval 15 Day) > modified""")
|
|
||||||
|
|
||||||
def get_support_mails():
|
def get_support_mails():
|
||||||
if cint(webnotes.conn.get_value('Email Settings', None, 'sync_support_mails')):
|
if cint(webnotes.conn.get_value('Email Settings', None, 'sync_support_mails')):
|
||||||
SupportMailbox()
|
SupportMailbox()
|
||||||
|
|||||||
@@ -67,3 +67,8 @@ def set_status(name, status):
|
|||||||
st = webnotes.bean("Support Ticket", name)
|
st = webnotes.bean("Support Ticket", name)
|
||||||
st.doc.status = status
|
st.doc.status = status
|
||||||
st.save()
|
st.save()
|
||||||
|
|
||||||
|
def auto_close_tickets():
|
||||||
|
webnotes.conn.sql("""update `tabSupport Ticket` set status = 'Closed'
|
||||||
|
where status = 'Replied'
|
||||||
|
and date_sub(curdate(),interval 15 Day) > modified""")
|
||||||
Reference in New Issue
Block a user