diff --git a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt index 8bc45f1303f..2f6ae86848c 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-05-17 17:27:49', + 'creation': '2012-05-16 14:07:31', 'docstatus': 0, - 'modified': '2012-05-17 17:53:54', + 'modified': '2012-06-04 16:02:12', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': u'Sales Invoice', 'doctype': 'Print Format', - 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n \n \t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', + 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n \n \t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': u'Accounts', 'name': '__common__', 'standard': u'Yes' diff --git a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt index c0957980a04..114650362e5 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-05-17 17:27:49', + 'creation': '2012-05-16 14:07:31', 'docstatus': 0, - 'modified': '2012-05-17 17:57:23', + 'modified': '2012-06-04 16:01:46', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': u'Sales Invoice', 'doctype': 'Print Format', - 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n \n \t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice No.
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', + 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n \n \t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice No.
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': u'Accounts', 'name': '__common__', 'standard': u'Yes' diff --git a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt index 01dd7654a55..77e6ef3830a 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-05-17 17:27:49', + 'creation': '2012-05-16 14:07:31', 'docstatus': 0, - 'modified': '2012-05-17 17:58:06', + 'modified': '2012-06-04 16:01:09', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -14,7 +14,7 @@ { 'doc_type': u'Sales Invoice', 'doctype': 'Print Format', - 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n \n \t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', + 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n \n \t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', 'module': u'Accounts', 'name': '__common__', 'standard': u'Yes' diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index 501ae40720f..d5300c75b5c 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -52,7 +52,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.hide_unhide_group_ledger = function(doc) { hide_field(['convert_to_group', 'convert_to_ledger']); if (cstr(doc.group_or_ledger) == 'Group') unhide_field('convert_to_ledger'); - else if (cstr(doc.group_or_ledger) == 'Ledger') unhide_field('convert_to_ledger'); + else if (cstr(doc.group_or_ledger) == 'Ledger') unhide_field('convert_to_group'); } // Convert group to ledger diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py index c16bb95ef16..2f84a9c7f4b 100644 --- a/erpnext/accounts/doctype/gl_control/gl_control.py +++ b/erpnext/accounts/doctype/gl_control/gl_control.py @@ -485,7 +485,8 @@ def manage_recurring_invoices(): and notify the concerned people """ rv = webnotes.conn.sql("""select name, recurring_id from `tabSales Invoice` where ifnull(convert_into_recurring_invoice, 0) = 1 - and next_date = %s and next_date <= end_date and docstatus=1 order by next_date desc""", nowdate()) + and next_date = %s and next_date <= ifnull(end_date, '2199-12-31') and docstatus=1""", nowdate()) + for d in rv: if not webnotes.conn.sql("""select name from `tabSales Invoice` where posting_date = %s and recurring_id = %s and docstatus=1""", (nowdate(), d[1])): prev_rv = get_obj('Sales Invoice', d[0], with_children=1) @@ -503,6 +504,8 @@ def create_new_invoice(prev_rv): new_rv.doc.posting_date = new_rv.doc.next_date new_rv.doc.aging_date = new_rv.doc.next_date new_rv.doc.due_date = add_days(new_rv.doc.next_date, cint(date_diff(prev_rv.doc.due_date, prev_rv.doc.posting_date))) + new_rv.doc.invoice_period_from_date = get_next_month_date(new_rv.doc.invoice_period_from_date) + new_rv.doc.invoice_period_to_date = get_next_month_date(new_rv.doc.invoice_period_to_date) new_rv.doc.owner = prev_rv.doc.owner new_rv.doc.save() @@ -512,6 +515,21 @@ def create_new_invoice(prev_rv): return new_rv +def get_next_month_date(dt): + import datetime + m = getdate(dt).month + 1 + y = getdate(dt).year + d = getdate(dt).day + if m > 12: + m, y = 1, y+1 + try: + next_month_date = datetime.date(y, m, d) + except: + import calendar + last_day = calendar.monthrange(y, m)[1] + next_month_date = datetime.date(y, m, last_day) + return next_month_date.strftime("%Y-%m-%d") + def send_notification(new_rv): """Notify concerned persons about recurring invoice generation""" @@ -528,7 +546,7 @@ def send_notification(new_rv): ''' % (com, new_rv.doc.name, new_rv.doc.customer, new_rv.doc.address_display, getdate(new_rv.doc.posting_date).strftime("%d-%m-%Y"), \ - getdate(add_days(add_months(new_rv.doc.posting_date, -1), 1)).strftime("%d-%m-%Y"), getdate(new_rv.doc.posting_date).strftime("%d-%m-%Y"),\ + getdate(new_rv.doc.invoice_period_from_date).strftime("%d-%m-%Y"), getdate(new_rv.doc.invoice_period_to_date).strftime("%d-%m-%Y"),\ getdate(new_rv.doc.due_date).strftime("%d-%m-%Y")) @@ -570,5 +588,4 @@ def send_notification(new_rv): msg = hd + tbl + totals from webnotes.utils.email_lib import sendmail - sendmail(recipients = new_rv.doc.notification_email_address.split(", "), \ - sender=new_rv.doc.owner, subject=subject, parts=[['text/plain', msg]]) + sendmail(new_rv.doc.notification_email_address.split(", "), subject=subject, msg = msg) \ No newline at end of file diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt index 1f7efb571d5..c70745e7e22 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:35:46', + 'creation': '2012-04-13 11:56:17', 'docstatus': 0, - 'modified': '2012-03-27 14:45:49', + 'modified': '2012-05-31 11:38:17', 'modified_by': u'Administrator', 'owner': u'jai@webnotestech.com' }, @@ -24,7 +24,7 @@ 'section_style': u'Simple', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 123 + 'version': 1 }, # These values are common for all DocField @@ -94,6 +94,20 @@ 'role': u'Accounts Manager' }, + # DocPerm + { + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'System Manager' + }, + + # DocPerm + { + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Accounts Manager' + }, + # DocPerm { 'amend': 1, @@ -117,20 +131,6 @@ 'write': 1 }, - # DocPerm - { - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'System Manager' - }, - - # DocPerm - { - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Accounts Manager' - }, - # DocField { 'doctype': u'DocField', @@ -238,6 +238,17 @@ 'trigger': u'Client' }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'coa_help', + 'fieldtype': u'HTML', + 'label': u'CoA Help', + 'oldfieldtype': u'HTML', + 'options': u'To manage Account Head, click here', + 'permlevel': 0 + }, + # DocField { 'doctype': u'DocField', diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 428e05096f8..3f333983b06 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -292,7 +292,7 @@ cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) // Expense Head // ------------- cur_frm.fields_dict['entries'].grid.get_field("expense_head").get_query = function(doc) { - return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.debit_or_credit="Debit" AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"'; + return 'SELECT tabAccount.name FROM tabAccount WHERE (tabAccount.debit_or_credit="Debit" OR tabAccount.account_type = "Expense Account") AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus != 2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"'; } cur_frm.cscript.expense_head = function(doc, cdt, cdn){ var d = locals[cdt][cdn]; diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index c3c43e04294..f57cfe7c17d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -127,7 +127,7 @@ class DocType(TransactionBase): def get_pv_details(self, arg): import json - item_det = sql("select item_name, brand, description, item_group, purchase_account, cost_center from tabItem where name=%s",arg,as_dict=1) + item_det = sql("select item_name, brand, description, item_group, purchase_account, cost_center, stock_uom from tabItem where name=%s",arg,as_dict=1) tax = sql("select tax_type, tax_rate from `tabItem Tax` where parent = %s" , arg) t = {} @@ -146,7 +146,8 @@ class DocType(TransactionBase): 'discount_rate': 0.00, 'expense_head': item_det and item_det[0]['purchase_account'] or '', 'cost_center': item_det and item_det[0]['cost_center'] or '', - 'item_tax_rate': json.dumps(t) + 'item_tax_rate': json.dumps(t), + 'uom': item_det and item_det[0]['stock_uom'] or '' } # get last purchase rate diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt index 236b75e2a2c..30493b3fa07 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:35:46', + 'creation': '2012-04-13 11:56:17', 'docstatus': 0, - 'modified': '2012-03-27 14:35:46', + 'modified': '2012-06-04 12:10:22', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -22,7 +22,7 @@ 'section_style': u'Tray', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 46 + 'version': 1 }, # These values are common for all DocField @@ -229,6 +229,17 @@ 'print_hide': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'uom', + 'fieldtype': u'Link', + 'label': u'UOM', + 'options': u'UOM', + 'permlevel': 0, + 'print_hide': 1 + }, + # DocField { 'doctype': u'DocField', @@ -345,4 +356,4 @@ 'print_hide': 1, 'report_hide': 1 } -] +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index abea87ca97b..2badf4d6be0 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -390,7 +390,7 @@ cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) { // Income Account in Details Table // -------------------------------- cur_frm.fields_dict.entries.grid.get_field("income_account").get_query = function(doc) { - return 'SELECT tabAccount.name FROM tabAccount WHERE tabAccount.debit_or_credit="Credit" AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus!=2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"'; + return 'SELECT tabAccount.name FROM tabAccount WHERE (tabAccount.debit_or_credit="Credit" OR tabAccount.account_type = "Income Account") AND tabAccount.group_or_ledger="Ledger" AND tabAccount.docstatus!=2 AND tabAccount.company="'+doc.company+'" AND tabAccount.%(key)s LIKE "%s"'; } // warehouse in detail table diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index af9de92bcd0..620d8dd5c05 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -508,29 +508,16 @@ class DocType(TransactionBase): msgprint("Delivery Note : "+ cstr(d.delivery_note) +" is not submitted") raise Exception , "Validation Error." + #Set Actual Qty based on item code and warehouse #------------------------------------------------------ def set_actual_qty(self): - for d in getlist(self.doclist, 'delivery_note_details'): - if d.item_code and d.warehouse: - actual_qty = webnotes.conn.sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (d.item_code, d.warehouse)) - d.actual_qty = actual_qty and flt(actual_qty[0][0]) or 0 - - # Check qty in stock depends on item code and warehouse - #------------------------------------------------------- - def check_qty_in_stock(self): for d in getlist(self.doclist, 'entries'): - is_stock_item = webnotes.conn.sql("select is_stock_item from `tabItem` where name = '%s'" % d.item_code)[0][0] - actual_qty = 0 if d.item_code and d.warehouse: actual_qty = webnotes.conn.sql("select actual_qty from `tabBin` where item_code = '%s' and warehouse = '%s'" % (d.item_code, d.warehouse)) - actual_qty = actual_qty and flt(actual_qty[0][0]) or 0 + d.actual_qty = actual_qty and flt(actual_qty[0][0]) or 0 - if is_stock_item == 'Yes' and flt(d.qty) > flt(actual_qty): - msgprint("For Item: " + cstr(d.item_code) + " at Warehouse: " + cstr(d.warehouse) + " Quantity: " + cstr(d.qty) +" is not Available. (Must be less than or equal to " + cstr(actual_qty) + " )") - raise Exception, "Validation Error" - # ********************** Make Stock Entry ************************************ def make_sl_entry(self, d, wh, qty, in_value, update_stock): @@ -569,7 +556,6 @@ class DocType(TransactionBase): #-------------------POS Stock Updatation Part---------------------------------------------- def pos_update_stock(self): - self.check_qty_in_stock() self.update_stock_ledger(update_stock = 1) # ********** Get Actual Qty of item in warehouse selected ************* @@ -697,6 +683,8 @@ class DocType(TransactionBase): def convert_into_recurring(self): if self.doc.convert_into_recurring_invoice: + if not self.doc.invoice_period_from_date or not self.doc.invoice_period_to_date: + msgprint("Invoice period from date and to date is mandatory for recurring invoice", raise_exception=1) self.set_next_date() if not self.doc.recurring_id: webnotes.conn.set(self.doc, 'recurring_id', make_autoname('RECINV/.#####')) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt index b1b4f4b4c9c..d2439c81132 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt @@ -5,7 +5,7 @@ { 'creation': '2012-04-13 11:56:18', 'docstatus': 0, - 'modified': '2012-05-14 14:09:43', + 'modified': '2012-06-04 14:40:59', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -1498,11 +1498,25 @@ { 'allow_on_submit': 1, 'depends_on': u'eval:doc.convert_into_recurring_invoice==1', - 'description': u'The date on which recurring invoice will be stop', + 'description': u'Start date of the invoice period', 'doctype': u'DocField', - 'fieldname': u'end_date', + 'fieldname': u'invoice_period_from_date', 'fieldtype': u'Date', - 'label': u'End Date', + 'label': u'Invoice Period From Date', + 'no_copy': 1, + 'permlevel': 0, + 'print_hide': 1 + }, + + # DocField + { + 'allow_on_submit': 1, + 'depends_on': u'eval:doc.convert_into_recurring_invoice==1', + 'description': u'End date of the invoice period', + 'doctype': u'DocField', + 'fieldname': u'invoice_period_to_date', + 'fieldtype': u'Date', + 'label': u'Invoice Period To Date', 'no_copy': 1, 'permlevel': 0, 'print_hide': 1 @@ -1559,6 +1573,20 @@ 'print_hide': 1 }, + # DocField + { + 'allow_on_submit': 1, + 'depends_on': u'eval:doc.convert_into_recurring_invoice==1', + 'description': u'The date on which recurring invoice will be stop', + 'doctype': u'DocField', + 'fieldname': u'end_date', + 'fieldtype': u'Date', + 'label': u'End Date', + 'no_copy': 1, + 'permlevel': 0, + 'print_hide': 1 + }, + # DocField { 'doctype': u'DocField', diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index 667a37eb97d..3f7792029c8 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -99,9 +99,11 @@ erpnext.AccountsChart = Class.extend({ }, onrender: function(treenode) { - var bal = treenode.data && treenode.data.balance.split(' ') || ['','']; - treenode.parent.append(''+ bal[0] + ' ' - + bal[1] + ''); + if (ctype == 'Account') { + var bal = treenode.data && treenode.data.balance.split(' ') || ['','']; + treenode.parent.append(''+ bal[0] + ' ' + + bal[1] + ''); + } } }); this.tree.rootnode.$a.click(); diff --git a/erpnext/home/page/desktop/desktop.js b/erpnext/home/page/desktop/desktop.js index 7bc2aba9cdb..0db20fb0c6e 100644 --- a/erpnext/home/page/desktop/desktop.js +++ b/erpnext/home/page/desktop/desktop.js @@ -125,6 +125,7 @@ erpnext.desktop.show_pending_notifications = function() { add_circle('support', 'open_support_tickets', 'Open Support Tickets'); add_circle('todo', 'things_todo', 'Things To Do'); add_circle('calendar', 'todays_events', 'Todays Events'); + add_circle('project', 'open_tasks', 'Open Tasks'); erpnext.update_messages(); diff --git a/erpnext/hr/doctype/attendance_control_panel/attendance_control_panel.py b/erpnext/hr/doctype/attendance_control_panel/attendance_control_panel.py index 06a9a760dcf..7726980d60d 100644 --- a/erpnext/hr/doctype/attendance_control_panel/attendance_control_panel.py +++ b/erpnext/hr/doctype/attendance_control_panel/attendance_control_panel.py @@ -85,7 +85,7 @@ class DocType: msgprint("Please create naming series for Attendance.\nGo to Setup--> Numbering Series.") raise Exception else: - sr = series[0][0] or '' + sr = series[0] or '' return {'fy':fy,'comp':comp,'sr':sr} diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 909a8b28d65..552a4c86be3 100644 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -59,13 +59,6 @@ class DocType: def validate(self): - if not self.doc.opening_date: - msgprint("Please enter Opening Date.") - raise Exception - elif getdate(self.doc.opening_date) > getdate(nowdate()): - msgprint("Opening date can not be future date") - raise Exception - if self.doc.exp_start_date and self.doc.exp_end_date and getdate(self.doc.exp_start_date) > getdate(self.doc.exp_end_date): msgprint("'Expected Start Date' can not be greater than 'Expected End Date'") raise Exception @@ -73,43 +66,32 @@ class DocType: if self.doc.act_start_date and self.doc.act_end_date and getdate(self.doc.act_start_date) > getdate(self.doc.act_end_date): msgprint("'Actual Start Date' can not be greater than 'Actual End Date'") raise Exception - - if self.doc.opening_date and self.doc.review_date and getdate(self.doc.opening_date) > getdate(self.doc.review_date): - msgprint("Review Date should be greater than or equal to Opening Date ") - raise Exception - - if self.doc.closing_date and self.doc.review_date and getdate(self.doc.closing_date) < getdate(self.doc.review_date): - msgprint("Closing Date should be greater than or equal to Review Date ") - raise Exception # on update #-------------------------------------------- def on_update(self): if self.doc.status =='Open' and self.doc.allocated_to: - if self.doc.task_email_notify and (self.doc.allocated_to != self.doc.allocated_to_old): - self.doc.sent_reminder = 0 - self.doc.allocated_to_old = self.doc.allocated_to - self.sent_notification() + if self.doc.task_email_notify: + self.send_notification() if self.doc.exp_start_date: sql("delete from tabEvent where ref_type='Task' and ref_name=%s", self.doc.name) self.add_calendar_event() else: - msgprint("An Expeted start date has not been set for this task.Please set 'Expected Start date'\ - to add an event to allocated persons calender.You can save a task without this also.") + msgprint("Tip: Add an expected start date to create a calendar event.") def validate_for_pending_review(self): if not self.doc.allocated_to: - msgprint("Please enter allocated_to.") + msgprint("Please enter Allocated To.") raise Exception self.validate_with_timesheet_dates() #Sent Notification - def sent_notification(self): + def send_notification(self): i = { 'name' : self.doc.name, - 'senders_name': self.doc.allocated_to, + 'senders_name': self.doc.senders_name, 'opening_date': self.doc.opening_date, 'exp_start_date': self.doc.exp_start_date, 'exp_end_date' : self.doc.exp_end_date, @@ -119,8 +101,12 @@ class DocType: 'description': self.doc.description } + task_label = '[Task Updated] ' + if self.doc.creation==self.doc.modified: + task_label = '[New Task] ' + msg2="""

%(name)s

-

This is a Notification for the task %(name)s that has been assigned to you +

This is a Notification for the task %(name)s that has been assigned / updated to you by %(senders_name)s on %(opening_date)s

Subject: %(subject)s

Project: %(project)s

@@ -128,11 +114,9 @@ class DocType:

Expected Start Date: %(exp_start_date)s

Expected End Date: %(exp_end_date)s

Details: %(description)s

-

You will also recieve another reminder 2 days before the commencement of the task

-

Good Luck!

(This notification is autogenerated)

""" % i sendmail(self.doc.allocated_to, sender='automail@webnotestech.com', msg=msg2,send_now=1,\ - subject='A task has been assigned') + subject= task_label + self.doc.subject) diff --git a/erpnext/projects/doctype/task/task.txt b/erpnext/projects/doctype/task/task.txt index 811071979bb..eedb651f38a 100644 --- a/erpnext/projects/doctype/task/task.txt +++ b/erpnext/projects/doctype/task/task.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:06', + 'creation': '2012-04-02 16:02:06', 'docstatus': 0, - 'modified': '2012-03-27 14:36:06', + 'modified': '2012-06-04 12:33:35', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -26,7 +26,7 @@ 'show_in_menu': 0, 'subject': u'%(subject)s', 'tag_fields': u'status', - 'version': 254 + 'version': 1 }, # These values are common for all DocField @@ -62,6 +62,7 @@ 'doctype': u'DocPerm', 'permlevel': 0, 'role': u'All', + 'submit': 0, 'write': 1 }, @@ -75,6 +76,7 @@ # DocPerm { + 'amend': 1, 'cancel': 1, 'create': 1, 'doctype': u'DocPerm', @@ -115,6 +117,79 @@ 'reqd': 1 }, + # DocField + { + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'allocated_to', + 'fieldtype': u'Link', + 'label': u'Allocated To', + 'oldfieldname': u'allocated_to', + 'oldfieldtype': u'Link', + 'options': u'Profile', + 'permlevel': 0, + 'trigger': u'Client' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'task_email_notify', + 'fieldtype': u'Check', + 'label': u'Send Mail Notification', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'exp_start_date', + 'fieldtype': u'Date', + 'label': u'Expected Start Date', + 'oldfieldname': u'exp_start_date', + 'oldfieldtype': u'Date', + 'permlevel': 0, + 'reqd': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'exp_end_date', + 'fieldtype': u'Date', + 'in_filter': 1, + 'label': u'Expected End Date', + 'oldfieldname': u'exp_end_date', + 'oldfieldtype': u'Date', + 'permlevel': 0, + 'reqd': 0, + 'search_index': 1 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'column_break0', + 'fieldtype': u'Column Break', + 'oldfieldtype': u'Column Break', + 'permlevel': 0, + 'width': u'50%' + }, + + # DocField + { + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'project', + 'fieldtype': u'Link', + 'label': u'Project', + 'oldfieldname': u'project', + 'oldfieldtype': u'Link', + 'options': u'Project', + 'permlevel': 0, + 'trigger': u'Client' + }, + # DocField { 'doctype': u'DocField', @@ -129,46 +204,6 @@ 'trigger': u'Client' }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'opening_date', - 'fieldtype': u'Date', - 'label': u'Creation Date', - 'oldfieldname': u'opening_date', - 'oldfieldtype': u'Date', - 'permlevel': 0, - 'reqd': 1 - }, - - # DocField - { - 'colour': u'White:FFF', - 'depends_on': u'eval:doc.status == "Closed" || doc.status == "Pending Review"', - 'doctype': u'DocField', - 'fieldname': u'review_date', - 'fieldtype': u'Date', - 'hidden': 1, - 'label': u'Review Date', - 'oldfieldname': u'review_date', - 'oldfieldtype': u'Date', - 'permlevel': 0 - }, - - # DocField - { - 'colour': u'White:FFF', - 'depends_on': u'eval:doc.status == "Closed"', - 'doctype': u'DocField', - 'fieldname': u'closing_date', - 'fieldtype': u'Date', - 'hidden': 1, - 'label': u'Closing Date', - 'oldfieldname': u'closing_date', - 'oldfieldtype': u'Date', - 'permlevel': 0 - }, - # DocField { 'doctype': u'DocField', @@ -186,16 +221,60 @@ # DocField { - 'colour': u'White:FFF', 'doctype': u'DocField', - 'fieldname': u'project', - 'fieldtype': u'Link', - 'label': u'Project', - 'oldfieldname': u'project', - 'oldfieldtype': u'Link', - 'options': u'Project', + 'fieldname': u'allocated_to_name', + 'fieldtype': u'Data', + 'hidden': 1, + 'label': u'Allocated To Name', + 'oldfieldname': u'allocated_to_name', + 'oldfieldtype': u'Data', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'section_break0', + 'fieldtype': u'Section Break', + 'oldfieldtype': u'Section Break', + 'options': u'Simple', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'description', + 'fieldtype': u'Text Editor', + 'label': u'Details', + 'oldfieldname': u'description', + 'oldfieldtype': u'Text Editor', 'permlevel': 0, - 'trigger': u'Client' + 'reqd': 0, + 'width': u'300px' + }, + + # DocField + { + 'colour': u'White:FFF', + 'description': u'If linked to a Customer', + 'doctype': u'DocField', + 'fieldname': u'customer_details', + 'fieldtype': u'Section Break', + 'label': u'Customer Details', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'external_or_internal', + 'fieldtype': u'Select', + 'label': u'External or Internal', + 'oldfieldname': u'external_or_internal', + 'oldfieldtype': u'Select', + 'options': u'External\nInternal', + 'permlevel': 0 }, # DocField @@ -223,73 +302,6 @@ 'permlevel': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'column_break0', - 'fieldtype': u'Column Break', - 'oldfieldtype': u'Column Break', - 'permlevel': 0, - 'width': u'50%' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'allocated_to_old', - 'fieldtype': u'Link', - 'hidden': 1, - 'label': u'Allocated To Old', - 'no_copy': 1, - 'permlevel': 0 - }, - - # DocField - { - 'colour': u'White:FFF', - 'doctype': u'DocField', - 'fieldname': u'allocated_to', - 'fieldtype': u'Link', - 'label': u'Allocated To', - 'oldfieldname': u'allocated_to', - 'oldfieldtype': u'Link', - 'options': u'Profile', - 'permlevel': 0, - 'trigger': u'Client' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'task_email_notify', - 'fieldtype': u'Check', - 'label': u'Sent Mail Notification', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'allocated_to_name', - 'fieldtype': u'Data', - 'hidden': 1, - 'label': u'Allocated To Name', - 'oldfieldname': u'allocated_to_name', - 'oldfieldtype': u'Data', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'sent_reminder', - 'fieldtype': u'Data', - 'hidden': 1, - 'label': u'Sent Reminder', - 'no_copy': 1, - 'permlevel': 0 - }, - # DocField { 'doctype': u'DocField', @@ -316,6 +328,14 @@ 'reqd': 0 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'column_break25', + 'fieldtype': u'Column Break', + 'permlevel': 0 + }, + # DocField { 'doctype': u'DocField', @@ -337,102 +357,6 @@ 'oldfieldtype': u'Data', 'permlevel': 0 }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'external_or_internal', - 'fieldtype': u'Select', - 'label': u'External or Internal', - 'oldfieldname': u'external_or_internal', - 'oldfieldtype': u'Select', - 'options': u'External\nInternal', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'amended_from', - 'fieldtype': u'Data', - 'hidden': 1, - 'label': u'Amended From', - 'no_copy': 1, - 'oldfieldname': u'amended_from', - 'oldfieldtype': u'Data', - 'permlevel': 1, - 'print_hide': 1, - 'report_hide': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'amendment_date', - 'fieldtype': u'Date', - 'hidden': 1, - 'label': u'Amendment Date', - 'no_copy': 1, - 'oldfieldname': u'amendment_date', - 'oldfieldtype': u'Date', - 'permlevel': 1, - 'print_hide': 1, - 'report_hide': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'section_break0', - 'fieldtype': u'Section Break', - 'oldfieldtype': u'Section Break', - 'options': u'Simple', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'description', - 'fieldtype': u'Text Editor', - 'label': u'Details', - 'oldfieldname': u'description', - 'oldfieldtype': u'Text Editor', - 'permlevel': 0, - 'reqd': 0, - 'width': u'300px' - }, - - # DocField - { - 'colour': u'White:FFF', - 'doctype': u'DocField', - 'fieldname': u'first_creation_flag', - 'fieldtype': u'Int', - 'hidden': 1, - 'in_filter': 0, - 'label': u'First Creation Flag', - 'no_copy': 1, - 'oldfieldname': u'first_creation_flag', - 'oldfieldtype': u'Int', - 'permlevel': 0, - 'print_hide': 1, - 'search_index': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'second_creation_flag', - 'fieldtype': u'Int', - 'hidden': 1, - 'label': u'Second Creation Flag', - 'no_copy': 1, - 'oldfieldname': u'second_creation_flag', - 'oldfieldtype': u'Int', - 'permlevel': 0, - 'print_hide': 1 - }, # DocField { @@ -455,32 +379,6 @@ 'width': u'50%' }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'exp_start_date', - 'fieldtype': u'Date', - 'label': u'Expected Start Date', - 'oldfieldname': u'exp_start_date', - 'oldfieldtype': u'Date', - 'permlevel': 0, - 'reqd': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'exp_end_date', - 'fieldtype': u'Date', - 'in_filter': 1, - 'label': u'Expected End Date', - 'oldfieldname': u'exp_end_date', - 'oldfieldtype': u'Date', - 'permlevel': 0, - 'reqd': 0, - 'search_index': 1 - }, - # DocField { 'doctype': u'DocField', @@ -557,5 +455,84 @@ 'oldfieldname': u'actual_budget', 'oldfieldtype': u'Currency', 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'more_details', + 'fieldtype': u'Section Break', + 'label': u'More Details', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'opening_date', + 'fieldtype': u'Date', + 'label': u'Creation Date', + 'oldfieldname': u'opening_date', + 'oldfieldtype': u'Date', + 'permlevel': 0, + 'reqd': 1 + }, + + # DocField + { + 'colour': u'White:FFF', + 'depends_on': u'eval:doc.status == "Closed" || doc.status == "Pending Review"', + 'doctype': u'DocField', + 'fieldname': u'review_date', + 'fieldtype': u'Date', + 'hidden': 1, + 'label': u'Review Date', + 'oldfieldname': u'review_date', + 'oldfieldtype': u'Date', + 'permlevel': 0 + }, + + # DocField + { + 'colour': u'White:FFF', + 'depends_on': u'eval:doc.status == "Closed"', + 'doctype': u'DocField', + 'fieldname': u'closing_date', + 'fieldtype': u'Date', + 'hidden': 1, + 'label': u'Closing Date', + 'oldfieldname': u'closing_date', + 'oldfieldtype': u'Date', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'amended_from', + 'fieldtype': u'Data', + 'hidden': 1, + 'label': u'Amended From', + 'no_copy': 1, + 'oldfieldname': u'amended_from', + 'oldfieldtype': u'Data', + 'permlevel': 1, + 'print_hide': 1, + 'report_hide': 1 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'amendment_date', + 'fieldtype': u'Date', + 'hidden': 1, + 'label': u'Amendment Date', + 'no_copy': 1, + 'oldfieldname': u'amendment_date', + 'oldfieldtype': u'Date', + 'permlevel': 1, + 'print_hide': 1, + 'report_hide': 1 } -] +] \ No newline at end of file diff --git a/erpnext/projects/page/projects/projects.js b/erpnext/projects/page/projects/projects.js index 59b039a8c34..9fec3c9bb6e 100644 --- a/erpnext/projects/page/projects/projects.js +++ b/erpnext/projects/page/projects/projects.js @@ -164,6 +164,13 @@ GanttGrid = function(chart, s_date, e_date) { this.make(); } +GanttGrid.prototype.make = function() { + this.body = make_table(this.wrapper, 1, 2, '100%', ['30%','70%']); + this.make_grid(); + this.make_labels(); + this.y_labels = $a($td(this.body, 0, 0), 'div', '', {marginTop:'2px', position:'relative'}); +} + GanttGrid.prototype.make_grid = function() { // grid ----------- var ht = this.chart.tasks.length * 40 + 'px'; @@ -191,17 +198,12 @@ GanttGrid.prototype.make_labels = function() { if(d.getDate()==today.getDate() && d.getMonth()==today.getMonth() && d.getYear() == today.getYear()) { $y($td(this.grid_tab,0,i),{borderLeft:'2px solid #000'}) } - var d = date.add_days(this.start_date, 1); + var d = date.str_to_obj(date.add_days(this.start_date, 1)); } this.start_date = date.str_to_obj(date.user_to_str(this.s_date)); } -GanttGrid.prototype.make = function() { - this.body = make_table(this.wrapper, 1, 2, '100%', ['30%','70%']); - this.make_grid(); - this.make_labels(); - this.y_labels = $a($td(this.body, 0, 0), 'div', '', {marginTop:'2px', position:'relative'}); -} + GanttGrid.prototype.get_x = function(dt) { var d = date.str_to_obj(dt); // convert to obj @@ -256,33 +258,18 @@ GanttTask = function(grid, data, idx) { } GanttTask.prototype.make_tooltip = function(d) { - var t = '
'; - if(d[0]) t += 'Task: ' + d[0]; - if(d[5]) t += '
Priority: ' + d[5]; - if(d[6]) t += '
Status: ' + d[6]; - if(d[1]) t += '
Allocated To: ' + d[1]; - if(d[2]) t += '
Project: ' + d[2]; - if(d[3]) t += '
From: ' + date.str_to_user(d[3]); - if(d[4]) t += '
To: ' + date.str_to_user(d[4]); - t += '
'; + $(this.body).click(function() { + var t = '
'; + if(d[0]) t += 'Task: ' + d[0]; + if(d[5]) t += '
Priority: ' + d[5]; + if(d[6]) t += '
Status: ' + d[6]; + if(d[1]) t += '
Allocated To: ' + d[1]; + if(d[2]) t += '
Project: ' + d[2]; + if(d[3]) t += '
From: ' + date.str_to_user(d[3]); + if(d[4]) t += '
To: ' + date.str_to_user(d[4]); + t += '
'; - $(this.body).qtip({ - content:t, - position:{ - corner:{ - tooltip: 'topMiddle', // Use the corner... - target: 'bottomMiddle' // ...and opposite corner - } - }, - style:{ - border: { - width: 5, - radius: 10 - }, - padding: 10, - tip: true, // Give it a speech bubble tip with automatic corner detection - name: 'green' // Style it according to the preset 'cream' style - } + msgprint(t) }) } diff --git a/erpnext/projects/page/projects_home/projects_home.html b/erpnext/projects/page/projects_home/projects_home.html index e86aa03d98c..81235a2f90d 100644 --- a/erpnext/projects/page/projects_home/projects_home.html +++ b/erpnext/projects/page/projects_home/projects_home.html @@ -4,12 +4,12 @@

Projects


-

Project

-

Project master

-

Task

Project activity / task


+

Project

+

Project master

+

Timesheet

Timesheet for tasks

diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index cdbf46c6f39..f49a1abca79 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -137,13 +137,6 @@ cur_frm.fields_dict['customer_group'].get_query = function(doc,dt,dn) { return 'SELECT `tabCustomer Group`.`name`, `tabCustomer Group`.`parent_customer_group` FROM `tabCustomer Group` WHERE `tabCustomer Group`.`is_group` = "No" AND `tabCustomer Group`.`docstatus`!= 2 AND `tabCustomer Group`.%(key)s LIKE "%s" ORDER BY `tabCustomer Group`.`name` ASC LIMIT 50'; } -cur_frm.cscript.CGHelp = function(doc,dt,dn){ - var call_back = function(){ - var sb_obj = new SalesBrowser(); - sb_obj.set_val('Customer Group'); - } - loadpage('Sales Browser',call_back); -} // ----- // lead @@ -196,6 +189,7 @@ cur_frm.cscript.get_common_list_view = function(parent, doc, doctype) { cur_frm.cscript.render_list(doc, doctype, parent, ListView); } + cur_frm.cscript.make_si_list = function(parent, doc) { var ListView = wn.views.ListView.extend({ init: function(doclistview) { diff --git a/erpnext/selling/doctype/lead/lead.js b/erpnext/selling/doctype/lead/lead.js index 6554a59b0f4..5d434495c01 100644 --- a/erpnext/selling/doctype/lead/lead.js +++ b/erpnext/selling/doctype/lead/lead.js @@ -23,7 +23,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { if(user =='Guest'){ hide_field(['status', 'naming_series', 'order_lost_reason', 'customer', 'rating', 'fax', 'website', 'territory', - 'TerritoryHelp', 'address_line1', 'address_line2', 'city', 'state', + 'address_line1', 'address_line2', 'city', 'state', 'country', 'pincode', 'address', 'lead_owner', 'market_segment', 'industry', 'campaign_name', 'interested_in', 'company', 'fiscal_year', 'contact_by', 'contact_date', 'last_contact_date', @@ -67,15 +67,6 @@ cur_frm.cscript.status = function(doc, cdt, cdn){ cur_frm.cscript.refresh(doc, cdt, cdn); } -cur_frm.cscript.TerritoryHelp = function(doc,dt,dn){ - var call_back = function(){ - var sb_obj = new SalesBrowser(); - sb_obj.set_val('Territory'); - } - - loadpage('Sales Browser',call_back); -} - //Trigger in Item Table //=================================== cur_frm.cscript.item_code=function(doc,cdt,cdn){ diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 9e7632748d3..660a288c25d 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -286,7 +286,7 @@ class DocType(TransactionBase): #----------------------------------------------------------------------------------------------- def validate_order_type(self): #validate delivery date - if self.doc.order_type != 'Maintenance' and not self.doc.delivery_date: + if self.doc.order_type == 'Sales' and not self.doc.delivery_date: msgprint("Please enter 'Expected Delivery Date'") raise Exception diff --git a/erpnext/setup/doctype/contact_control/contact_control.js b/erpnext/setup/doctype/contact_control/contact_control.js index 2482660fc92..bb505f64815 100755 --- a/erpnext/setup/doctype/contact_control/contact_control.js +++ b/erpnext/setup/doctype/contact_control/contact_control.js @@ -66,16 +66,6 @@ cur_frm.cscript.country = function(doc, dt, dn) { cur_frm.cscript.get_states(doc, dt, dn); } -// territory help - cutsomer + sales partner -// ----------------------------------------- -cur_frm.cscript.TerritoryHelp = function(doc,dt,dn){ - var call_back = function(){ - - var sb_obj = new SalesBrowser(); - sb_obj.set_val('Territory'); - } - loadpage('Sales Browser',call_back); -} // get query select Territory // --------------------------- @@ -83,4 +73,4 @@ if(cur_frm.fields_dict['territory']){ cur_frm.fields_dict['territory'].get_query = function(doc,dt,dn) { return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50'; } -} \ No newline at end of file +} diff --git a/erpnext/setup/doctype/item_group/item_group.js b/erpnext/setup/doctype/item_group/item_group.js index 40b66d3dff8..db7582ce112 100644 --- a/erpnext/setup/doctype/item_group/item_group.js +++ b/erpnext/setup/doctype/item_group/item_group.js @@ -26,7 +26,7 @@ cur_frm.cscript.onload = function(){ //get query select item group cur_frm.fields_dict['parent_item_group'].get_query = function(doc,cdt,cdn) { - return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` FROM `tabItem Group` WHERE `tabItem Group`.`is_group` = "Yes" AND `tabItem Group`.`docstatus`!= 2 AND (`tabItem Group`.`rgt` > '+doc.rgt+' or `tabItem Group`.`lft` < '+doc.lft+') AND `tabItem Group`.`name` !="'+doc.item_group_name+'" AND `tabItem Group`.%(key)s LIKE "%s" ORDER BY `tabItem Group`.`name` ASC LIMIT 50'; + return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` FROM `tabItem Group` WHERE `tabItem Group`.`is_group` = "Yes" AND `tabItem Group`.`docstatus`!= 2 AND `tabItem Group`.`name` !="'+doc.item_group_name+'" AND `tabItem Group`.%(key)s LIKE "%s" ORDER BY `tabItem Group`.`name` ASC LIMIT 50'; } cur_frm.cscript.refresh = function(doc, cdt, cdn) { diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 4a5d5d09df5..161ce4e1b4c 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -52,7 +52,7 @@ class DocType: def validate(self): if self.doc.lft and self.doc.rgt: - res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_item_group,self.doc.item_group_name)) + res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and name ='%s' and name !='%s'"%(self.doc.parent_item_group,self.doc.item_group_name)) if not res: msgprint("Please enter proper parent item group.") raise Exception diff --git a/erpnext/setup/doctype/sales_person/sales_person.js b/erpnext/setup/doctype/sales_person/sales_person.js index 0057ff0d778..b0419bd871c 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.js +++ b/erpnext/setup/doctype/sales_person/sales_person.js @@ -38,19 +38,10 @@ cur_frm.cscript.country = function(doc, cdt, cdn) { ); } -cur_frm.cscript.TreePage = function(nm){ - var call_back = function(){ - var sb_obj = new SalesBrowser(); - sb_obj.set_val(nm); - - } - loadpage('Sales Browser',call_back); - -} //get query select sales person cur_frm.fields_dict['parent_sales_person'].get_query = function(doc,cdt,cdn) { - return 'SELECT `tabSales Person`.`name`,`tabSales Person`.`parent_sales_person` FROM `tabSales Person` WHERE `tabSales Person`.`is_group` = "Yes" AND `tabSales Person`.`docstatus`!= 2 AND (`tabSales Person`.`rgt` > '+doc.rgt+' or `tabSales Person`.`lft` < '+doc.lft+') AND `tabSales Person`.`name` !="'+doc.sales_person_name+'" AND `tabSales Person`.%(key)s LIKE "%s" ORDER BY `tabSales Person`.`name` ASC LIMIT 50'; + return 'SELECT `tabSales Person`.`name`,`tabSales Person`.`parent_sales_person` FROM `tabSales Person` WHERE `tabSales Person`.`is_group` = "Yes" AND `tabSales Person`.`docstatus`!= 2 AND `tabSales Person`.`name` !="'+doc.sales_person_name+'" AND `tabSales Person`.%(key)s LIKE "%s" ORDER BY `tabSales Person`.`name` ASC LIMIT 50'; } //get query select Territory diff --git a/erpnext/setup/doctype/sales_person/sales_person.txt b/erpnext/setup/doctype/sales_person/sales_person.txt index 45769e1ea8c..5ff8e9414dc 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.txt +++ b/erpnext/setup/doctype/sales_person/sales_person.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:23', + 'creation': '2012-04-13 11:56:32', 'docstatus': 0, - 'modified': '2012-03-27 18:49:47', + 'modified': '2012-05-31 11:28:32', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -25,7 +25,7 @@ 'section_style': u'Simple', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 132 + 'version': 1 }, # These values are common for all DocField @@ -55,6 +55,46 @@ 'name': u'Sales Person' }, + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Sales Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales User', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Sales User', + 'write': 0 + }, + # DocPerm { 'cancel': 1, @@ -75,46 +115,6 @@ 'write': 0 }, - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Sales Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales User', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Sales User', - 'write': 0 - }, - # DocField { 'doctype': u'DocField', @@ -316,7 +316,7 @@ 'fieldtype': u'HTML', 'label': u'Territory Help', 'oldfieldtype': u'HTML', - 'options': u'To manage Territory, click here', + 'options': u'To manage Territories, click here', 'permlevel': 0 }, diff --git a/erpnext/setup/doctype/territory/territory.js b/erpnext/setup/doctype/territory/territory.js index 3752f26a26a..46312c4e51a 100644 --- a/erpnext/setup/doctype/territory/territory.js +++ b/erpnext/setup/doctype/territory/territory.js @@ -31,7 +31,7 @@ cur_frm.cscript.onload = function(){ //get query select territory cur_frm.fields_dict['parent_territory'].get_query = function(doc,cdt,cdn) { - return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "Yes" AND `tabTerritory`.`docstatus`!= 2 AND (`tabTerritory`.`rgt` > '+doc.rgt+' or `tabTerritory`.`lft` < '+doc.lft+') AND `tabTerritory`.`name` !="'+doc.territory_name+'" AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50'; + return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "Yes" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.`name` !="'+doc.territory_name+'" AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50'; } @@ -39,13 +39,3 @@ cur_frm.fields_dict['parent_territory'].get_query = function(doc,cdt,cdn) { cur_frm.fields_dict['target_details'].grid.get_field("item_group").get_query = function(doc, cdt, cdn) { return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` FROM `tabItem Group` WHERE `tabItem Group`.is_group="No" AND `tabItem Group`.docstatus != 2 AND `tabItem Group`.%(key)s LIKE "%s" LIMIT 50' } - -cur_frm.cscript.TerritoryHelp = function(doc,dt,dn){ - var call_back = function(){ - var sb_obj = new SalesBrowser(); - sb_obj.set_val('Territory'); - - } - loadpage('Sales Browser',call_back); - -} \ No newline at end of file diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py index 5f71cf6535b..606efa8ef93 100644 --- a/erpnext/setup/doctype/territory/territory.py +++ b/erpnext/setup/doctype/territory/territory.py @@ -61,7 +61,7 @@ class DocType: def validate(self): if self.doc.lft and self.doc.rgt: - res = sql("select name from `tabTerritory` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_territory,self.doc.territory_name)) + res = sql("select name from `tabTerritory` where is_group = 'Yes' and docstatus!= 2 and name ='%s' and name !='%s'"%(self.doc.parent_territory,self.doc.territory_name)) if not res: msgprint("Please enter proper parent territory.") raise Exception diff --git a/erpnext/setup/doctype/territory/territory.txt b/erpnext/setup/doctype/territory/territory.txt index 2a1cc4d76a0..363280128cb 100644 --- a/erpnext/setup/doctype/territory/territory.txt +++ b/erpnext/setup/doctype/territory/territory.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:25', + 'creation': '2012-04-13 11:56:32', 'docstatus': 0, - 'modified': '2012-03-27 18:50:08', + 'modified': '2012-05-31 11:39:33', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -27,7 +27,7 @@ 'section_style': u'Simple', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 87 + 'version': 1 }, # These values are common for all DocField @@ -57,6 +57,56 @@ 'name': u'Territory' }, + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Sales Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales Master Manager', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 1, + 'role': u'Sales User', + 'write': 0 + }, + + # DocPerm + { + 'cancel': 0, + 'create': 0, + 'doctype': u'DocPerm', + 'permlevel': 0, + 'role': u'Sales User', + 'write': 0 + }, + # DocPerm { 'cancel': 1, @@ -67,56 +117,6 @@ 'write': 1 }, - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Sales Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales Master Manager', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 1, - 'role': u'Sales User', - 'write': 0 - }, - - # DocPerm - { - 'cancel': 0, - 'create': 0, - 'doctype': u'DocPerm', - 'permlevel': 0, - 'role': u'Sales User', - 'write': 0 - }, - # DocField { 'doctype': u'DocField', @@ -176,7 +176,7 @@ 'fieldtype': u'HTML', 'label': u'TerritoryHelp', 'oldfieldtype': u'HTML', - 'options': u'To manage Territory, click here', + 'options': u'To manage Territories, click here', 'permlevel': 0 }, diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 2efe55d74f5..9ea3c8959a3 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -135,6 +135,7 @@ erpnext.update_messages = function(reset) { show_in_circle('open_support_tickets', r.message.open_support_tickets); show_in_circle('things_todo', r.message.things_todo); show_in_circle('todays_events', r.message.todays_events); + show_in_circle('open_tasks', r.message.open_tasks); } else { clearInterval(wn.updates.id); diff --git a/erpnext/startup/startup.py b/erpnext/startup/startup.py index 8bc13f8678d..f21f2519feb 100644 --- a/erpnext/startup/startup.py +++ b/erpnext/startup/startup.py @@ -20,6 +20,15 @@ def get_open_support_tickets(): WHERE status = 'Open'""") return open_support_tickets and cint(open_support_tickets[0][0]) or 0 +def get_open_tasks(): + """ + Returns a count of open tasks + """ + from webnotes.utils import cint + return webnotes.conn.sql("""\ + SELECT COUNT(*) FROM `tabTask` + WHERE status = 'Open'""")[0][0] + def get_things_todo(): """ Returns a count of incomplete todos @@ -51,4 +60,5 @@ def get_global_status_messages(arg=None): 'open_support_tickets': get_open_support_tickets(), 'things_todo': get_things_todo(), 'todays_events': get_todays_events(), + 'open_tasks': get_open_tasks() } diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 33e5f77225a..65698c1f87c 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -80,15 +80,6 @@ cur_frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) { return 'SELECT `tabItem Group`.`name`,`tabItem Group`.`parent_item_group` FROM `tabItem Group` WHERE `tabItem Group`.`is_group` = "No" AND `tabItem Group`.`docstatus`!= 2 AND `tabItem Group`.%(key)s LIKE "%s" ORDER BY `tabItem Group`.`name` ASC LIMIT 50' } -cur_frm.cscript.IGHelp = function(doc,dt,dn){ - var call_back = function(){ - var sb_obj = new SalesBrowser(); - sb_obj.set_val('Item Group'); - - } - loadpage('Sales Browser',call_back); -} - // for description from attachment // takes the first attachment and creates // a table with both image and attachment in HTML diff --git a/erpnext/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.txt index 9cdb99f008f..d23e3ca99db 100644 --- a/erpnext/stock/doctype/item/item.txt +++ b/erpnext/stock/doctype/item/item.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-04-02 16:02:29', + 'creation': '2012-04-30 18:33:53', 'docstatus': 0, - 'modified': '2012-04-30 14:08:08', + 'modified': '2012-05-31 11:18:10', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -216,7 +216,7 @@ 'fieldtype': u'HTML', 'label': u'IGHelp', 'oldfieldtype': u'HTML', - 'options': u'To manage Item Group, click here', + 'options': u'To manage Item Groups, click here', 'permlevel': 0 }, diff --git a/erpnext/stock/doctype/serial_no/serial_no.js b/erpnext/stock/doctype/serial_no/serial_no.js index 00929eccb02..901acd2e7d4 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.js +++ b/erpnext/stock/doctype/serial_no/serial_no.js @@ -59,3 +59,12 @@ cur_frm.cscript.supplier = function(doc,dt,dn) { if(doc.supplier) get_server_fields('get_default_supplier_address', JSON.stringify({supplier: doc.supplier}),'', doc, dt, dn, 1); if(doc.supplier) unhide_field(['supplier_name','address_display']); } + +//item code +//---------- +cur_frm.fields_dict['item_code'].get_query = function(doc,cdt,cdn) { + return 'SELECT `tabItem`.`name`,`tabItem`.`description` FROM `tabItem` \ + WHERE `tabItem`.`docstatus`!= 2 AND ifnull(`tabItem`.`has_serial_no`, "No") = "Yes" \ + AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") \ + AND `tabItem`.%(key)s LIKE "%s" ORDER BY `tabItem`.`name` ASC LIMIT 50'; +} \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 996e435bcf6..b40a4137b8f 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -37,7 +37,8 @@ var cfn_set_fields = function(doc, cdt, cdn) { else hide_field(['production_order', 'process']); doc.from_warehouse = ''; - doc.to_warehosue = ''; + doc.to_warehouse = ''; + refresh_field(['from_warehosue', 'to_warehouse']); if (doc.process == 'Backflush' || doc.purpose == 'Other'){ unhide_field('fg_completed_qty'); } diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index c8035dc549c..27ec01e5e57 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -114,7 +114,7 @@ class DocType(TransactionBase): """ Add calendar event for Maintenece Schedule in calendar of Allocated person""" event = Document('Event') event.owner = incharge_email - event.description = "Item Code:%s and Reference:%s" %(item_code,self.doc.name) + event.description = "Reference:%s, Item Code:%s and Customer: %s" %(self.doc.name, item_code, self.doc.customer) event.event_date = scheduled_date event.event_hour = '10:00' event.event_type = 'Private' diff --git a/public/js/all-app.js b/public/js/all-app.js index ce55ff9c356..ae2b63d2db4 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -473,9 +473,8 @@ var doc_link=DocLink;function roundNumber(num,dec){var result=Math.round(num*Mat function same_day(d1,d2){if(d1.getFullYear()==d2.getFullYear()&&d1.getMonth()==d2.getMonth()&&d1.getDate()==d2.getDate())return true;else return false;} var month_list=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];var month_last={1:31,2:28,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31} var month_list_full=['January','February','March','April','May','June','July','August','September','October','November','December'];var week_list=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];var week_list_full=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];function int_to_str(i,len){i=''+i;if(i.length