diff --git a/erpnext/buying/Report/Supplier Quotations/Supplier Quotations.txt b/erpnext/buying/Report/Supplier Quotations/Supplier Quotations.txt new file mode 100644 index 00000000000..860a432810b --- /dev/null +++ b/erpnext/buying/Report/Supplier Quotations/Supplier Quotations.txt @@ -0,0 +1,26 @@ +# Report, Supplier Quotations +[ + + # These values are common in all dictionaries + { + 'creation': '2012-08-07 14:52:42', + 'docstatus': 0, + 'modified': '2012-08-07 14:57:57', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Report + { + 'doctype': 'Report', + 'json': u'{"filters":[["Supplier Quotation","supplier","like","%%"],["Supplier Quotation Item","item_code","like","%%"]],"columns":[["name","Supplier Quotation"],["supplier","Supplier Quotation"],["item_code","Supplier Quotation Item"],["description","Supplier Quotation Item"],["qty","Supplier Quotation Item"],["currency","Supplier Quotation"],["import_rate","Supplier Quotation Item"],["import_amount","Supplier Quotation Item"]],"sort_by":"modified","sort_order":"desc","sort_by_next":"name","sort_order_next":"desc"}', + 'name': '__common__', + 'ref_doctype': u'Supplier Quotation' + }, + + # Report, Supplier Quotations + { + 'doctype': 'Report', + 'name': u'Supplier Quotations' + } +] \ No newline at end of file diff --git a/erpnext/home/page/desktop/desktop.js b/erpnext/home/page/desktop/desktop.js index 0db20fb0c6e..9ba5253e41e 100644 --- a/erpnext/home/page/desktop/desktop.js +++ b/erpnext/home/page/desktop/desktop.js @@ -126,6 +126,7 @@ erpnext.desktop.show_pending_notifications = function() { add_circle('todo', 'things_todo', 'Things To Do'); add_circle('calendar', 'todays_events', 'Todays Events'); add_circle('project', 'open_tasks', 'Open Tasks'); + add_circle('kb', 'unanswered_questions', 'Unanswered Questions'); erpnext.update_messages(); diff --git a/erpnext/patches/august_2012/__init__.py b/erpnext/patches/august_2012/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/patches/august_2012/report_supplier_quotations.py b/erpnext/patches/august_2012/report_supplier_quotations.py new file mode 100644 index 00000000000..bb0347910bf --- /dev/null +++ b/erpnext/patches/august_2012/report_supplier_quotations.py @@ -0,0 +1,3 @@ +def execute(): + from webnotes.modules import reload_doc + reload_doc("buying", "Report", "Supplier Quotations") \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 735287e8be1..e61a8efc344 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -541,4 +541,8 @@ patch_list = [ 'patch_module': 'patches.july_2012', 'patch_file': 'supplier_quotation', }, + { + 'patch_module': 'patches.august_2012', + 'patch_file': 'report_supplier_quotations', + }, ] \ No newline at end of file diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 9ea3c8959a3..60104645b02 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -136,6 +136,7 @@ erpnext.update_messages = function(reset) { 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); + show_in_circle('unanswered_questions', r.message.unanswered_questions); } else { clearInterval(wn.updates.id); diff --git a/erpnext/startup/startup.py b/erpnext/startup/startup.py index c990207fe91..0ae31141fed 100644 --- a/erpnext/startup/startup.py +++ b/erpnext/startup/startup.py @@ -12,9 +12,7 @@ def get_unread_messages(): """, webnotes.user.name, as_list=1) def get_open_support_tickets(): - """ - Returns a count of open support tickets - """ + """Returns a count of open support tickets""" from webnotes.utils import cint open_support_tickets = webnotes.conn.sql("""\ SELECT COUNT(*) FROM `tabSupport Ticket` @@ -22,18 +20,14 @@ def get_open_support_tickets(): return open_support_tickets and cint(open_support_tickets[0][0]) or 0 def get_open_tasks(): - """ - Returns a count of 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 - """ + """Returns a count of incomplete todos""" from webnotes.utils import cint incomplete_todos = webnotes.conn.sql("""\ SELECT COUNT(*) FROM `tabToDo` @@ -42,9 +36,7 @@ def get_things_todo(): return incomplete_todos and cint(incomplete_todos[0][0]) or 0 def get_todays_events(): - """ - Returns a count of todays events in calendar - """ + """Returns a count of todays events in calendar""" from webnotes.utils import nowdate, cint todays_events = webnotes.conn.sql("""\ SELECT COUNT(*) FROM `tabEvent` @@ -54,6 +46,11 @@ def get_todays_events(): webnotes.session.get('user'), nowdate())) return todays_events and cint(todays_events[0][0]) or 0 +def get_unanswered_questions(): + return len(filter(lambda d: d[0]==0, + webnotes.conn.sql("""select (select count(*) from tabAnswer + where tabAnswer.question = tabQuestion.name) as answers from tabQuestion"""))) + @webnotes.whitelist() def get_global_status_messages(arg=None): return { @@ -61,5 +58,6 @@ 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() + 'open_tasks': get_open_tasks(), + 'unanswered_questions': get_unanswered_questions() } diff --git a/erpnext/utilities/page/kb_common/kb_common.js b/erpnext/utilities/page/kb_common/kb_common.js index d77a938e0ed..9d6b7e8e0ba 100644 --- a/erpnext/utilities/page/kb_common/kb_common.js +++ b/erpnext/utilities/page/kb_common/kb_common.js @@ -25,6 +25,7 @@ KBItemToolbar = function(args, kb) { this.wrapper = $a(this.parent, 'div', '', {}); this.line1 = $a(this.wrapper, 'div', '', {color: '#888', fontSize:'11px', margin:'7px 0px'}); this.make_timestamp(); + this.make_answers(); if(this.with_tags) this.make_tags(); this.setup_del(); @@ -43,6 +44,18 @@ KBItemToolbar = function(args, kb) { } } + this.make_answers = function() { + if(this.doctype=='Question') { + if(this.det.answers==0) { + this.line1.innerHTML += ' | no answers'; + } else if(this.det.answers==1) { + this.line1.innerHTML += ' | 1 answer'; + } else { + this.line1.innerHTML += ' | '+this.det.answers+' answers'; + } + } + } + this.make_tags = function() { this.line1.innerHTML += ' | ' this.tags_area = $a(this.line1, 'span', 'kb-tags') @@ -80,7 +93,7 @@ EditableText = function(args) {
\ [edit]\ \ - \ \ Cancel\ diff --git a/erpnext/utilities/page/markdown_reference/__init__.py b/erpnext/utilities/page/markdown_reference/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/utilities/page/markdown_reference/markdown_reference.css b/erpnext/utilities/page/markdown_reference/markdown_reference.css new file mode 100644 index 00000000000..e69de29bb2d diff --git a/erpnext/utilities/page/markdown_reference/markdown_reference.html b/erpnext/utilities/page/markdown_reference/markdown_reference.html new file mode 100644 index 00000000000..5af414f275f --- /dev/null +++ b/erpnext/utilities/page/markdown_reference/markdown_reference.html @@ -0,0 +1,150 @@ +*italic* **bold**
+_italic_ __bold__
+
+
+Inline:
+ +An [example](http://url.com/ "Title")
+
+
+Reference-style labels (titles are optional):
+ +An [example][id]. Then, anywhere
+else in the doc, define the link:
+
+ [id]: http://example.com/ "Title"
+
+
+Inline (titles are optional):
+ +
+
+
+Reference-style:
+ +![alt text][id]
+
+ [id]: /url/to/img.jpg "Title"
+
+
+Setext-style:
+ +Header 1
+========
+
+Header 2
+--------
+
+
+
+atx-style (closing #'s are optional):
+ +# Header 1 #
+
+
+
+
+Ordered, without paragraphs:
+ +1. Foo
+2. Bar
+
+
+Unordered, with paragraphs:
+ +* A list item.
+
+ With multiple paragraphs.
+
+* Bar
+
+
+You can nest them:
+ +* Abacus
+ * ass
+* Bastard
+ 1. bitch
+ 2. bupkis
+ * BELITTLER
+ 3. burper
+* Cunning
+
+
+> Email-style angle brackets
+
+> are used for blockquotes.
+
+> > And, they can be nested.
+
+> >
+> * You can quote a list.
+> * Etc.
+
+
+`<code>` spans are delimited
+by backticks.
+
+You can include literal backticks
+like `` `this` ``.
+
+
+Indent every line of a code block by at least 4 spaces or 1 tab, and use a colon at the end of the preceding paragraph.
+ +This is a normal paragraph:
+
+ This is a preformatted
+ code block.
+
+Preceded by a space, the colon
+disappears. :
+
+ This is a preformatted
+ code block.
+
+
+Three or more dashes or asterisks:
+ +---
+
+* * *
+
+- - - -
+
+
+End a line with two or more spaces:
+ +Roses are red,
+Violets are blue.
+
+