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

This commit is contained in:
Rushabh Mehta
2013-07-05 10:51:51 +05:30
20 changed files with 277 additions and 344 deletions

View File

@@ -1,123 +0,0 @@
[
{
"creation": "2010-08-08 17:09:35",
"docstatus": 0,
"modified": "2013-07-03 18:00:40",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Table Mapper Detail",
"name": "__common__",
"parent": "Purchase Order-Purchase Invoice",
"parentfield": "table_mapper_details",
"parenttype": "DocType Mapper"
},
{
"doctype": "Field Mapper Detail",
"name": "__common__",
"parent": "Purchase Order-Purchase Invoice",
"parentfield": "field_mapper_details",
"parenttype": "DocType Mapper"
},
{
"doctype": "DocType Mapper",
"from_doctype": "Purchase Order",
"module": "Accounts",
"name": "__common__",
"ref_doc_submitted": 1,
"to_doctype": "Purchase Invoice"
},
{
"doctype": "DocType Mapper",
"name": "Purchase Order-Purchase Invoice"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.amount) - flt(obj.billed_amt)) / obj.purchase_rate",
"map": "Yes",
"match_id": 1,
"to_field": "qty"
},
{
"doctype": "Field Mapper Detail",
"from_field": "purchase_rate",
"map": "Yes",
"match_id": 1,
"to_field": "rate"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: flt(obj.amount) - flt(obj.billed_amt)",
"map": "Yes",
"match_id": 1,
"to_field": "amount"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.conversion_rate)",
"map": "Yes",
"match_id": 1,
"to_field": "import_amount"
},
{
"doctype": "Field Mapper Detail",
"from_field": "parent",
"map": "Yes",
"match_id": 1,
"to_field": "purchase_order"
},
{
"doctype": "Field Mapper Detail",
"from_field": "name",
"map": "Yes",
"match_id": 1,
"to_field": "po_detail"
},
{
"doctype": "Field Mapper Detail",
"from_field": "naming_series",
"map": "No",
"match_id": 0,
"to_field": "naming_series"
},
{
"doctype": "Field Mapper Detail",
"from_field": "total_tax",
"map": "Yes",
"match_id": 0,
"to_field": "total_tax"
},
{
"doctype": "Field Mapper Detail",
"from_field": "conversion_rate",
"map": "Yes",
"match_id": 0,
"to_field": "conversion_rate"
},
{
"doctype": "Table Mapper Detail",
"from_table": "Purchase Order",
"match_id": 0,
"to_table": "Purchase Invoice",
"validation_logic": "docstatus =1"
},
{
"doctype": "Table Mapper Detail",
"from_field": "po_details",
"from_table": "Purchase Order Item",
"match_id": 1,
"to_field": "entries",
"to_table": "Purchase Invoice Item",
"validation_logic": "ifnull(billed_amt,0) < amount and docstatus = 1"
},
{
"doctype": "Table Mapper Detail",
"from_field": "purchase_tax_details",
"from_table": "Purchase Taxes and Charges",
"match_id": 2,
"to_field": "purchase_tax_details",
"to_table": "Purchase Taxes and Charges",
"validation_logic": "docstatus =1"
}
]

View File

@@ -1,144 +0,0 @@
[
{
"creation": "2010-08-08 17:09:35",
"docstatus": 0,
"modified": "2013-07-03 17:56:30",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Table Mapper Detail",
"name": "__common__",
"parent": "Purchase Receipt-Purchase Invoice",
"parentfield": "table_mapper_details",
"parenttype": "DocType Mapper"
},
{
"doctype": "Field Mapper Detail",
"name": "__common__",
"parent": "Purchase Receipt-Purchase Invoice",
"parentfield": "field_mapper_details",
"parenttype": "DocType Mapper"
},
{
"doctype": "DocType Mapper",
"from_doctype": "Purchase Receipt",
"module": "Accounts",
"name": "__common__",
"ref_doc_submitted": 1,
"to_doctype": "Purchase Invoice"
},
{
"doctype": "DocType Mapper",
"name": "Purchase Receipt-Purchase Invoice"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.amount) - flt(obj.billed_amt)) / obj.purchase_rate",
"map": "Yes",
"match_id": 1,
"to_field": "qty"
},
{
"doctype": "Field Mapper Detail",
"from_field": "purchase_rate",
"map": "Yes",
"match_id": 1,
"to_field": "rate"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: flt(obj.amount) - flt(obj.billed_amt)",
"map": "Yes",
"match_id": 1,
"to_field": "amount"
},
{
"doctype": "Field Mapper Detail",
"from_field": "eval: (flt(obj.amount) - flt(obj.billed_amt)) / flt(obj.conversion_rate)",
"map": "Yes",
"match_id": 1,
"to_field": "import_amount"
},
{
"doctype": "Field Mapper Detail",
"from_field": "parent",
"map": "Yes",
"match_id": 1,
"to_field": "purchase_receipt"
},
{
"doctype": "Field Mapper Detail",
"from_field": "prevdoc_docname",
"map": "Yes",
"match_id": 1,
"to_field": "purchase_order"
},
{
"doctype": "Field Mapper Detail",
"from_field": "name",
"map": "Yes",
"match_id": 1,
"to_field": "pr_detail"
},
{
"doctype": "Field Mapper Detail",
"from_field": "prevdoc_detail_docname",
"map": "Yes",
"match_id": 1,
"to_field": "po_detail"
},
{
"doctype": "Field Mapper Detail",
"from_field": "naming_series",
"map": "No",
"match_id": 0,
"to_field": "naming_series"
},
{
"doctype": "Field Mapper Detail",
"from_field": "net_total",
"map": "Yes",
"match_id": 0,
"to_field": "net_total"
},
{
"doctype": "Field Mapper Detail",
"from_field": "grand_total",
"map": "Yes",
"match_id": 0,
"to_field": "grand_total"
},
{
"doctype": "Field Mapper Detail",
"from_field": "total_tax",
"map": "Yes",
"match_id": 0,
"to_field": "total_tax"
},
{
"doctype": "Table Mapper Detail",
"from_field": "purchase_receipt_details",
"from_table": "Purchase Receipt Item",
"match_id": 1,
"to_field": "entries",
"to_table": "Purchase Invoice Item",
"validation_logic": "ifnull(billed_amt,0) < amount"
},
{
"doctype": "Table Mapper Detail",
"from_table": "Purchase Receipt",
"match_id": 0,
"to_table": "Purchase Invoice",
"validation_logic": "docstatus=1"
},
{
"doctype": "Table Mapper Detail",
"from_field": "purchase_tax_details",
"from_table": "Purchase Taxes and Charges",
"match_id": 2,
"to_field": "purchase_tax_details",
"to_table": "Purchase Taxes and Charges",
"validation_logic": "docstatus=1"
}
]

View File

@@ -18,7 +18,7 @@ from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt, fmt_money
from webnotes import msgprint
from webnotes import msgprint, _
sql = webnotes.conn.sql
get_value = webnotes.conn.get_value
@@ -196,10 +196,23 @@ class DocType:
if parts[-1].lower() != company_abbr.lower():
parts.append(company_abbr)
# rename account name
account_name = " - ".join(parts[:-1])
sql("update `tabAccount` set account_name = %s where name = %s", (account_name, old))
new_account_name = " - ".join(parts[:-1])
sql("update `tabAccount` set account_name = %s where name = %s", (new_account_name, old))
if merge:
new_name = " - ".join(parts)
val = list(webnotes.conn.get_value("Account", new_name,
["group_or_ledger", "debit_or_credit", "is_pl_account"]))
if val != [self.doc.group_or_ledger, self.doc.debit_or_credit, self.doc.is_pl_account]:
msgprint(_("""Merging is only possible if following \
properties are same in both records.
Group or Ledger, Debit or Credit, Is PL Account"""), raise_exception=1)
from webnotes.utils.nestedset import rebuild_tree
rebuild_tree("Account", "parent_account")
return " - ".join(parts)

View File

@@ -2,6 +2,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cint
class DocType:
def __init__(self, d, dl):

View File

@@ -98,5 +98,7 @@ class DocType(DocTypeNestedSet):
cost_center_name = " - ".join(parts[:-1])
webnotes.conn.sql("update `tabCost Center` set cost_center_name = %s where name = %s", \
(cost_center_name, old))
super(DocType, self).on_rename(new, old, merge, "group_or_ledger")
return " - ".join(parts)

View File

@@ -58,7 +58,7 @@ def execute(filters=None):
row.append(invoice_tax_map.get(inv.name, {}).get(tax_acc))
# total tax, grand total, outstanding amount & rounded total
row += [inv.other_charges_total, inv.grand_total, flt(inv.grand_total, 2), \
row += [inv.total_tax, inv.grand_total, flt(inv.grand_total, 2), \
inv.outstanding_amount]
data.append(row)
@@ -164,4 +164,4 @@ def get_account_details(invoice_list):
where name in (%s)""" % ", ".join(["%s"]*len(accounts)), tuple(accounts), as_dict=1):
account_map[acc.name] = acc.parent_account
return account_map
return account_map