Merge pull request #1297 from nabinhait/hotfix

Hotfix
This commit is contained in:
Nabin Hait 2014-01-08 23:18:54 -08:00
commit 701cddfb15
5 changed files with 20 additions and 11 deletions

View File

@ -140,13 +140,13 @@ def gl_entry_details(doctype, txt, searchfield, start, page_len, filters):
and ifnull(gle.%(account_type)s, 0) > 0
and (select ifnull(abs(sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))), 0)
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 voucher_no != gle.voucher_no)
!= abs(ifnull(gle.debit, 0) - ifnull(gle.credit, 0)
)
and if(gle.voucher_type='Sales Invoice', (select is_pos from `tabSales Invoice`
where name=gle.voucher_no), 0)=0
!= abs(ifnull(gle.debit, 0) - ifnull(gle.credit, 0))
and if(gle.voucher_type='Sales Invoice', ifnull((select is_pos from `tabSales Invoice`
where name=gle.voucher_no), 0), 0)=0
%(mcond)s
ORDER BY gle.posting_date desc, gle.voucher_no desc
limit %(start)s, %(page_len)s""" % {

View File

@ -72,6 +72,11 @@ def get_conditions(filters):
if filters.get("voucher_no"):
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 ""

View File

@ -53,6 +53,10 @@ def execute_daily():
# email digest
from setup.doctype.email_digest.email_digest import 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():
from setup.doctype.backup_manager.backup_manager import take_backups_weekly

View File

@ -52,11 +52,6 @@ Original Query:
subject = '['+cstr(d.name)+'] ' + cstr(d.subject), \
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():
if cint(webnotes.conn.get_value('Email Settings', None, 'sync_support_mails')):
SupportMailbox()

View File

@ -66,4 +66,9 @@ class DocType(TransactionBase):
def set_status(name, status):
st = webnotes.bean("Support Ticket", name)
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""")