diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js index 06c014cb78..8b35bc1028 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.js @@ -33,6 +33,7 @@ cur_frm.cscript.refresh = function(doc) { } cur_frm.fields_dict.voucher_no.get_query = function(doc) { + // TO-do: check for pos, it should not come if (!doc.account) msgprint("Please select Account first"); else { return repl("select gle.voucher_no, gle.posting_date, gle.%(account_type)s \ @@ -44,7 +45,8 @@ cur_frm.fields_dict.voucher_no.get_query = function(doc) { and (ifnull(gle.against_voucher, '') = '' \ or ifnull(gle.against_voucher, '') = gle.voucher_no ) \ and ifnull(gle.%(account_type)s, 0) > 0 \ - and (select ifnull(abs(sum(debit) - sum(credit)), 0) from `tabGL Entry` \ + and (select ifnull(abs(sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))), 0) \ + from `tabGL Entry` \ where against_voucher_type = '%(dt)s' \ and against_voucher = gle.voucher_no \ and voucher_no != gle.voucher_no \ diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index d585ceaefa..b75142b66e 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -39,16 +39,14 @@ class DocType: (self.doc.voucher_type, self.doc.voucher_no, self.doc.account)) total_amount = total_amount and flt(total_amount[0][0]) or 0 - reconciled_payment = webnotes.conn.sql(""" - select sum(%s) - sum(%s) from `tabGL Entry` where + select sum(ifnull(%s, 0)) - sum(ifnull(%s, 0)) from `tabGL Entry` where against_voucher = %s and voucher_no != %s and account = %s and ifnull(is_cancelled, 'No') = 'No'""" % ((self.doc.account_type == 'debit' and 'credit' or 'debit'), self.doc.account_type, '%s', '%s', '%s'), (self.doc.voucher_no, self.doc.voucher_no, self.doc.account)) reconciled_payment = reconciled_payment and flt(reconciled_payment[0][0]) or 0 - ret = { 'total_amount': total_amount, 'pending_amt_to_reconcile': total_amount - reconciled_payment diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.py b/accounts/doctype/purchase_invoice/purchase_invoice.py index 8512b01831..db0ddd807d 100644 --- a/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -269,9 +269,6 @@ class DocType(BuyingController): if not cstr(data[0]['currency']) == cstr(self.doc.currency): msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " currency : " + cstr(data[0]['currency']) + " does not match with currency of current document.") raise Exception - if not flt(data[0]['conversion_rate']) == flt(self.doc.conversion_rate): - msgprint("Purchase Receipt: " + cstr(d.purchase_receipt) + " conversion_rate : " + cstr(data[0]['conversion_rate']) + " does not match with conversion_rate of current document.") - raise Exception def set_aging_date(self): if self.doc.is_opening != 'Yes': diff --git a/buying/doctype/purchase_common/purchase_common.js b/buying/doctype/purchase_common/purchase_common.js index a149db56f5..3a9d89110f 100644 --- a/buying/doctype/purchase_common/purchase_common.js +++ b/buying/doctype/purchase_common/purchase_common.js @@ -419,7 +419,7 @@ cur_frm.cscript.validate = function(doc, cdt, cdn) { cur_frm.cscript.calc_amount(doc, 1); // calculate advances if pv - if(doc.doctype == 'Purchase Invoice') calc_total_advance(doc, cdt, cdn); + if(doc.docstatus == 0 && doc.doctype == 'Purchase Invoice') calc_total_advance(doc, cdt, cdn); } // **************** RE-CALCULATE VALUES *************************** diff --git a/selling/doctype/sales_common/sales_common.js b/selling/doctype/sales_common/sales_common.js index 50b97a2b55..6a618c9a1a 100644 --- a/selling/doctype/sales_common/sales_common.js +++ b/selling/doctype/sales_common/sales_common.js @@ -891,7 +891,8 @@ cur_frm.cscript.validate = function(doc, cdt, cdn) { } cur_frm.cscript.calculate_charges (doc, cdt, cdn); - if (cur_frm.cscript.calc_adjustment_amount) cur_frm.cscript.calc_adjustment_amount(doc); + if (doc.docstatus == 0 && cur_frm.cscript.calc_adjustment_amount) + cur_frm.cscript.calc_adjustment_amount(doc); } diff --git a/startup/install.py b/startup/install.py index d94fd64b0e..b42b7163c0 100644 --- a/startup/install.py +++ b/startup/install.py @@ -33,7 +33,7 @@ def make_roles(): "Partner", "Projects User", "Purchase Manager", "Purchase Master Manager", "Purchase User", "Quality Manager", "Sales Manager", "Sales Master Manager", "Sales User", "Supplier", "Support Manager", - "Support Team"] + "Support Team", "Website Manager"] for r in roles: doc = webnotes.doc(fielddata = { diff --git a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt index fd73c879ff..8c20d4cd67 100755 --- a/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt +++ b/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt @@ -2,7 +2,7 @@ { "creation": "2013-02-07 08:28:23", "docstatus": 0, - "modified": "2013-02-08 14:06:15", + "modified": "2013-02-11 08:13:11", "modified_by": "Administrator", "owner": "Administrator" }, @@ -385,6 +385,7 @@ "hidden": 1, "in_filter": 0, "label": "Raw Materials Supplied Cost", + "no_copy": 1, "oldfieldname": "rm_supp_cost", "oldfieldtype": "Currency", "options": "Company:company:default_currency", diff --git a/website/doctype/web_page/web_page.txt b/website/doctype/web_page/web_page.txt index 788f1c04d1..861ac86e39 100644 --- a/website/doctype/web_page/web_page.txt +++ b/website/doctype/web_page/web_page.txt @@ -1,8 +1,8 @@ [ { - "creation": "2013-01-10 16:34:32", + "creation": "2013-01-27 16:31:21", "docstatus": 0, - "modified": "2013-01-22 14:57:27", + "modified": "2013-02-12 09:33:47", "modified_by": "Administrator", "owner": "Administrator" }, @@ -66,6 +66,7 @@ "doctype": "DocField", "fieldname": "page_name", "fieldtype": "Data", + "in_list_view": 1, "label": "Page Name", "read_only": 1 }, diff --git a/website/helpers/product.py b/website/helpers/product.py index 2685d10ed8..ef433b1a29 100644 --- a/website/helpers/product.py +++ b/website/helpers/product.py @@ -28,9 +28,7 @@ def get_product_info(item_code): } @webnotes.whitelist(allow_guest=True) -def get_product_list(search=None, product_group=None, start=0, limit=10): - # DOUBT: why is product_group param passed? - +def get_product_list(search=None, start=0, limit=10): # base query query = """select name, item_name, page_name, website_image, item_group, web_long_description as website_description @@ -47,7 +45,6 @@ def get_product_list(search=None, product_group=None, start=0, limit=10): data = webnotes.conn.sql(query, { "search": search, - "product_group": product_group }, as_dict=1) return [get_item_for_list_in_html(r) for r in data] diff --git a/website/utils.py b/website/utils.py index cd1b6a5974..48ca844ae9 100644 --- a/website/utils.py +++ b/website/utils.py @@ -19,7 +19,6 @@ from __future__ import unicode_literals import os import conf import webnotes -from webnotes.utils import cstr page_map = { 'Web Page': webnotes._dict({ @@ -52,7 +51,7 @@ def render(page_name): html = get_html(page_name) else: html = get_html('index') - except Exception, e: + except Exception: html = get_html('error') from webnotes.handler import eprint, print_zip @@ -244,7 +243,7 @@ def get_outer_env(): }) settings = webnotes.doc("Website Settings", "Website Settings") - for k in ["brand_html", "copyright", "address", "top_bar_background"]: + for k in ["brand_html", "copyright", "address", "top_bar_background", "favicon"]: if k in settings.fields: ret[k] = settings.fields[k]