Merge branch 'master' into edge

This commit is contained in:
Rushabh Mehta 2013-02-12 19:23:48 +05:30
commit 51709b7eb3
10 changed files with 16 additions and 20 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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':

View File

@ -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 ***************************

View File

@ -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);
}

View File

@ -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 = {

View File

@ -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",

View File

@ -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
},

View File

@ -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]

View File

@ -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]