Merge branch 'responsive' of git://github.com/webnotes/erpnext into responsive

This commit is contained in:
Nabin Hait
2013-07-03 11:48:10 +05:30
43 changed files with 664 additions and 220 deletions

View File

@@ -50,6 +50,7 @@ cur_frm.fields_dict.voucher_no.get_query = function(doc) {
where against_voucher_type = '%(dt)s' \
and against_voucher = gle.voucher_no \
and voucher_no != gle.voucher_no \
and account = gle.account \
and ifnull(is_cancelled, 'No') = 'No') != \
abs(ifnull(gle.debit, 0) - ifnull(gle.credit, 0)) \
ORDER BY gle.posting_date DESC, gle.voucher_no DESC LIMIT 50",

View File

@@ -147,7 +147,7 @@ cur_frm.cscript.account_head = function(doc, cdt, cdn) {
d.account_head = '';
}
else if(d.account_head && d.charge_type) {
arg = "{'charge_type' : '" + d.charge_type +"', 'account_head' : '" + d.account_head + "'}";
arg = "{'charge_type' : '" + d.charge_type + "', 'account_head' : '" + d.account_head + "'}";
get_server_fields('get_rate', arg, 'purchase_tax_details', doc, cdt, cdn, 1);
}
refresh_field('account_head',d.name,'purchase_tax_details');

View File

@@ -26,11 +26,11 @@ sql = webnotes.conn.sql
class DocType:
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
def __init__(self, doc, doclist=[]):
self.doc = doc
self.doclist = doclist
# Get Tax Rate if account type is Tax
# ===================================================================
def get_rate(self, arg):
return get_obj('Purchase Common').get_rate(arg, self)
# Get Tax Rate if account type is Tax
# ===================================================================
def get_rate(self, arg):
return get_obj('Purchase Common').get_rate(arg, self)

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-04-19 11:00:07",
"creation": "2013-06-04 11:02:19",
"docstatus": 0,
"modified": "2013-05-22 12:07:00",
"modified": "2013-06-26 14:34:00",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -243,7 +243,8 @@
"oldfieldname": "serial_no",
"oldfieldtype": "Small Text",
"print_hide": 0,
"read_only": 0
"read_only": 0,
"reqd": 0
},
{
"doctype": "DocField",

View File

@@ -21,8 +21,7 @@ from controllers.trends import get_columns,get_data
def execute(filters=None):
if not filters: filters ={}
data = []
trans = "Purchase Invoice"
conditions = get_columns(filters, trans)
conditions = get_columns(filters, "Purchase Invoice")
data = get_data(filters, conditions)
return conditions["columns"], data

View File

@@ -40,9 +40,10 @@ def execute(filters=None):
# invoice details
purchase_order = list(set(invoice_po_pr_map.get(inv.name, {}).get("purchase_order", [])))
purchase_receipt = list(set(invoice_po_pr_map.get(inv.name, {}).get("purchase_receipt", [])))
project_name = list(set(invoice_po_pr_map.get(inv.name, {}).get("project_name", [])))
row = [inv.name, inv.posting_date, inv.supplier, inv.credit_to,
account_map.get(inv.credit_to), inv.project_name, inv.bill_no, inv.bill_date,
account_map.get(inv.credit_to), ", ".join(project_name), inv.bill_no, inv.bill_date,
inv.remarks, ", ".join(purchase_order), ", ".join(purchase_receipt)]
# map expense values
@@ -105,11 +106,10 @@ def get_conditions(filters):
def get_invoices(filters):
conditions = get_conditions(filters)
return webnotes.conn.sql("""select pi.name, pi.posting_date, pi.credit_to,
pii.project_name, pi.supplier, pi.bill_no, pi.bill_date, pi.remarks, pi.net_total,
pi.total_tax, pi.grand_total, pi.outstanding_amount
from `tabPurchase Invoice` pi, `tabPurchase Invoice Item` pii
where pii.parent = pi.name and pi.docstatus = 1 %s
return webnotes.conn.sql("""select name, posting_date, credit_to,
supplier, bill_no, bill_date, remarks, net_total,
total_tax, grand_total, outstanding_amount
from `tabPurchase Invoice` where docstatus = 1 %s
order by posting_date desc, name desc""" % conditions, filters, as_dict=1)
@@ -138,8 +138,8 @@ def get_invoice_tax_map(invoice_list):
return invoice_tax_map
def get_invoice_po_pr_map(invoice_list):
pi_items = webnotes.conn.sql("""select parent, purchase_order, purchase_receipt
from `tabPurchase Invoice Item` where parent in (%s)
pi_items = webnotes.conn.sql("""select parent, purchase_order, purchase_receipt,
project_name from `tabPurchase Invoice Item` where parent in (%s)
and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')""" %
', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1)
@@ -151,6 +151,9 @@ def get_invoice_po_pr_map(invoice_list):
if d.purchase_receipt:
invoice_po_pr_map.setdefault(d.parent, webnotes._dict()).setdefault(
"purchase_receipt", []).append(d.purchase_receipt)
if d.project_name:
invoice_po_pr_map.setdefault(d.parent, webnotes._dict()).setdefault(
"project_name", []).append(d.project_name)
return invoice_po_pr_map

View File

@@ -21,8 +21,7 @@ from controllers.trends import get_columns,get_data
def execute(filters=None):
if not filters: filters ={}
data = []
trans = "Sales Invoice"
conditions = get_columns(filters, trans)
conditions = get_columns(filters, "Sales Invoice")
data = get_data(filters, conditions)
return conditions["columns"], data