[get_query] to server side

This commit is contained in:
Saurabh
2013-07-09 16:34:50 +05:30
65 changed files with 921 additions and 1207 deletions

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-02-22 01:27:37",
"creation": "2013-03-07 11:55:04",
"docstatus": 0,
"modified": "2013-03-07 07:03:19",
"modified": "2013-07-09 14:44:37",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -44,7 +44,7 @@
"label": "Budget Allocated",
"oldfieldname": "budget_allocated",
"oldfieldtype": "Currency",
"options": "Company:company_name:default_currency",
"options": "Company:company:default_currency",
"reqd": 1
},
{
@@ -54,7 +54,7 @@
"label": "Actual",
"oldfieldname": "actual",
"oldfieldtype": "Currency",
"options": "Company:company_name:default_currency",
"options": "Company:company:default_currency",
"read_only": 1
},
{

View File

@@ -17,7 +17,7 @@
cur_frm.cscript.refresh = function(doc, cdt, cdn) {
var intro_txt = '';
cur_frm.toggle_display('cost_center_name', doc.__islocal);
cur_frm.toggle_enable(['group_or_ledger', 'company_name'], doc.__islocal);
cur_frm.toggle_enable(['group_or_ledger', 'company'], doc.__islocal);
if(!doc.__islocal && doc.group_or_ledger=='Group') {
intro_txt += '<p><b>Note:</b> This Cost Center is a <i>Group</i>, \
@@ -61,7 +61,7 @@ cur_frm.fields_dict['parent_cost_center'].get_query = function(doc){
//parent cost center
cur_frm.cscript.parent_cost_center = function(doc,cdt,cdn){
if(!doc.company_name){
if(!doc.company){
alert('Please enter company name first');
}
}

View File

@@ -28,16 +28,16 @@ class DocType(DocTypeNestedSet):
def autoname(self):
company_abbr = webnotes.conn.sql("select abbr from tabCompany where name=%s",
self.doc.company_name)[0][0]
self.doc.company)[0][0]
self.doc.name = self.doc.cost_center_name.strip() + ' - ' + company_abbr
def validate_mandatory(self):
if not self.doc.group_or_ledger:
msgprint("Please select Group or Ledger value", raise_exception=1)
if self.doc.cost_center_name != self.doc.company_name and not self.doc.parent_cost_center:
if self.doc.cost_center_name != self.doc.company and not self.doc.parent_cost_center:
msgprint("Please enter parent cost center", raise_exception=1)
elif self.doc.cost_center_name == self.doc.company_name and self.doc.parent_cost_center:
elif self.doc.cost_center_name == self.doc.company and self.doc.parent_cost_center:
msgprint(_("Root cannot have a parent cost center"), raise_exception=1)
def convert_group_to_ledger(self):
@@ -81,14 +81,14 @@ class DocType(DocTypeNestedSet):
"""
Cost Center name must be unique
"""
if (self.doc.fields.get("__islocal") or not self.doc.name) and webnotes.conn.sql("select name from `tabCost Center` where cost_center_name = %s and company_name=%s", (self.doc.cost_center_name, self.doc.company_name)):
if (self.doc.fields.get("__islocal") or not self.doc.name) and webnotes.conn.sql("select name from `tabCost Center` where cost_center_name = %s and company=%s", (self.doc.cost_center_name, self.doc.company)):
msgprint("Cost Center Name already exists, please rename", raise_exception=1)
self.validate_mandatory()
self.validate_budget_details()
def on_rename(self, new, old, merge=False):
company_abbr = webnotes.conn.get_value("Company", self.doc.company_name, "abbr")
company_abbr = webnotes.conn.get_value("Company", self.doc.company, "abbr")
parts = new.split(" - ")
if parts[-1].lower() != company_abbr.lower():

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-01-23 19:57:17",
"docstatus": 0,
"modified": "2013-07-05 14:33:05",
"modified": "2013-07-09 14:43:41",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -81,7 +81,7 @@
},
{
"doctype": "DocField",
"fieldname": "company_name",
"fieldname": "company",
"fieldtype": "Link",
"label": "Company",
"oldfieldname": "company_name",

View File

@@ -3,7 +3,7 @@ test_records = [
"doctype": "Cost Center",
"cost_center_name": "_Test Cost Center",
"parent_cost_center": "_Test Company - _TC",
"company_name": "_Test Company",
"company": "_Test Company",
"group_or_ledger": "Ledger"
}],
]

View File

@@ -120,7 +120,7 @@ class DocType:
def _get_cost_center_company():
if not self.cost_center_company.get(self.doc.cost_center):
self.cost_center_company[self.doc.cost_center] = webnotes.conn.get_value("Cost Center",
self.doc.cost_center, "company_name")
self.doc.cost_center, "company")
return self.cost_center_company[self.doc.cost_center]

View File

@@ -99,4 +99,4 @@ cur_frm.fields_dict["expense_account"].get_query = function(doc) {
cur_frm.fields_dict.user.get_query = function(doc,cdt,cdn) {
return{ query:"controllers.queries.profile_query"}
}
}

View File

@@ -261,6 +261,7 @@ cur_frm.fields_dict["entries"].grid.get_field("cost_center").get_query = functio
'company_name': doc.company,
'group_or_ledger': 'Ledger'
}
}
}

View File

@@ -75,6 +75,7 @@ class DocType(BuyingController):
self.validate_write_off_account()
self.update_raw_material_cost()
self.update_valuation_rate("entries")
self.validate_multiple_billing("Purchase Receipt", "pr_detail", "import_amount")
def get_credit_to(self):
acc_head = sql("""select name, credit_days from `tabAccount`
@@ -206,17 +207,17 @@ class DocType(BuyingController):
},
"Purchase Order Item": {
"ref_dn_field": "po_detail",
"compare_fields": [["export_rate", "="], ["project_name", "="], ["item_code", "="],
"compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
["uom", "="]],
"is_child_table": True
},
"Purchase Receipt": {
"ref_dn_field": "purchase_receipt",
"compare_fields": [["customer", "="], ["company", "="], ["currency", "="]],
"compare_fields": [["supplier", "="], ["company", "="], ["currency", "="]],
},
"Purchase Receipt Item": {
"ref_dn_field": "pr_detail",
"compare_fields": [["export_rate", "="], ["project_name", "="], ["item_code", "="],
"compare_fields": [["import_rate", "="], ["project_name", "="], ["item_code", "="],
["uom", "="]],
"is_child_table": True
}

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-21 16:16:39",
"docstatus": 0,
"modified": "2013-07-08 18:03:17",
"modified": "2013-07-09 12:51:06",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -172,7 +172,7 @@
"fieldname": "bill_no",
"fieldtype": "Data",
"in_filter": 1,
"label": "Bill No",
"label": "Supplier Invoice No",
"oldfieldname": "bill_no",
"oldfieldtype": "Data",
"print_hide": 1,
@@ -185,7 +185,7 @@
"fieldname": "bill_date",
"fieldtype": "Date",
"in_filter": 1,
"label": "Bill Date",
"label": "Supplier Invoice Date",
"oldfieldname": "bill_date",
"oldfieldtype": "Date",
"print_hide": 1,
@@ -195,37 +195,34 @@
},
{
"doctype": "DocField",
"fieldname": "items",
"fieldtype": "Section Break",
"label": "Items",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"read_only": 0
},
{
"allow_on_submit": 1,
"doctype": "DocField",
"fieldname": "entries",
"fieldtype": "Table",
"label": "Entries",
"oldfieldname": "entries",
"oldfieldtype": "Table",
"options": "Purchase Invoice Item",
"read_only": 0
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Link",
"options": "Purchase Invoice",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "recalculate",
"fieldtype": "Button",
"label": "Recalculate",
"oldfieldtype": "Button",
"read_only": 0
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"print_hide": 1,
"read_only": 0,
"search_index": 1
},
{
"doctype": "DocField",
"fieldname": "currency_price_list",
"fieldtype": "Section Break",
"label": "Currency & Price List",
"label": "Currency and Price List",
"options": "icon-tag",
"read_only": 0
},
@@ -287,6 +284,59 @@
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "items",
"fieldtype": "Section Break",
"label": "Items",
"oldfieldtype": "Section Break",
"options": "icon-shopping-cart",
"read_only": 0
},
{
"allow_on_submit": 1,
"doctype": "DocField",
"fieldname": "entries",
"fieldtype": "Table",
"label": "Entries",
"oldfieldname": "entries",
"oldfieldtype": "Table",
"options": "Purchase Invoice Item",
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "section_break_26",
"fieldtype": "Section Break"
},
{
"doctype": "DocField",
"fieldname": "net_total_import",
"fieldtype": "Currency",
"label": "Net Total",
"oldfieldname": "net_total_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "column_break_28",
"fieldtype": "Column Break"
},
{
"description": "Will be calculated automatically when you enter the details",
"doctype": "DocField",
"fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total (Company Currency)",
"oldfieldname": "net_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1
},
{
"description": "Add / Edit Taxes and Charges",
"doctype": "DocField",
@@ -308,16 +358,6 @@
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "get_tax_detail",
"fieldtype": "Button",
"label": "Get Tax Detail",
"oldfieldtype": "Button",
"options": "get_purchase_tax_details",
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "purchase_tax_details",
@@ -328,15 +368,6 @@
"options": "Purchase Taxes and Charges",
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "calculate_tax",
"fieldtype": "Button",
"label": "Calculate Tax",
"oldfieldtype": "Button",
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "tax_calculation",
@@ -346,50 +377,6 @@
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "total_tax",
"fieldtype": "Currency",
"label": "Total Tax",
"oldfieldname": "total_tax",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 1
},
{
"depends_on": "supplier",
"doctype": "DocField",
"fieldname": "contact_section",
"fieldtype": "Section Break",
"label": "Contact Info",
"options": "icon-bullhorn",
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "supplier_address",
"fieldtype": "Link",
"label": "Supplier Address",
"options": "Address",
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "col_break23",
"fieldtype": "Column Break",
"read_only": 0,
"width": "50%"
},
{
"doctype": "DocField",
"fieldname": "contact_person",
"fieldtype": "Link",
"label": "Contact Person",
"options": "Contact",
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "totals",
@@ -399,22 +386,11 @@
"options": "icon-money",
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "net_total_import",
"fieldtype": "Currency",
"label": "Net Total (Import)",
"oldfieldname": "net_total_import",
"oldfieldtype": "Currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "other_charges_added_import",
"fieldtype": "Currency",
"label": "Taxes and Charges Added (Import)",
"label": "Taxes and Charges Added",
"oldfieldname": "other_charges_added_import",
"oldfieldtype": "Currency",
"options": "currency",
@@ -425,7 +401,7 @@
"doctype": "DocField",
"fieldname": "other_charges_deducted_import",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted (Import)",
"label": "Taxes and Charges Deducted",
"oldfieldname": "other_charges_deducted_import",
"oldfieldtype": "Currency",
"options": "currency",
@@ -437,7 +413,7 @@
"fieldname": "grand_total_import",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total (Import)",
"label": "Grand Total",
"oldfieldname": "grand_total_import",
"oldfieldtype": "Currency",
"options": "currency",
@@ -448,7 +424,7 @@
"doctype": "DocField",
"fieldname": "in_words_import",
"fieldtype": "Data",
"label": "In Words (Import)",
"label": "In Words",
"oldfieldname": "in_words_import",
"oldfieldtype": "Data",
"print_hide": 1,
@@ -504,12 +480,11 @@
"width": "50%"
},
{
"description": "Will be calculated automatically when you enter the details",
"doctype": "DocField",
"fieldname": "net_total",
"fieldname": "total_tax",
"fieldtype": "Currency",
"label": "Net Total",
"oldfieldname": "net_total",
"label": "Total Tax (Company Currency)",
"oldfieldname": "total_tax",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
@@ -519,7 +494,7 @@
"doctype": "DocField",
"fieldname": "other_charges_added",
"fieldtype": "Currency",
"label": "Taxes and Charges Added",
"label": "Taxes and Charges Added (Company Currency)",
"oldfieldname": "other_charges_added",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -530,7 +505,7 @@
"doctype": "DocField",
"fieldname": "other_charges_deducted",
"fieldtype": "Currency",
"label": "Taxes and Charges Deducted",
"label": "Taxes and Charges Deducted (Company Currency)",
"oldfieldname": "other_charges_deducted",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -541,7 +516,7 @@
"doctype": "DocField",
"fieldname": "grand_total",
"fieldtype": "Currency",
"label": "Grand Total",
"label": "Grand Total (Company Currency)",
"oldfieldname": "grand_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -553,7 +528,7 @@
"doctype": "DocField",
"fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
"oldfieldtype": "Data",
"print_hide": 1,
@@ -657,6 +632,39 @@
"fieldtype": "Text Editor",
"label": "Terms and Conditions1"
},
{
"depends_on": "supplier",
"doctype": "DocField",
"fieldname": "contact_section",
"fieldtype": "Section Break",
"label": "Contact Info",
"options": "icon-bullhorn",
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "supplier_address",
"fieldtype": "Link",
"label": "Supplier Address",
"options": "Address",
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "col_break23",
"fieldtype": "Column Break",
"read_only": 0,
"width": "50%"
},
{
"doctype": "DocField",
"fieldname": "contact_person",
"fieldtype": "Link",
"label": "Contact Person",
"options": "Contact",
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "more_info",
@@ -694,18 +702,6 @@
"read_only": 0,
"search_index": 0
},
{
"doctype": "DocField",
"fieldname": "amended_from",
"fieldtype": "Link",
"label": "Amended From",
"no_copy": 1,
"oldfieldname": "amended_from",
"oldfieldtype": "Link",
"options": "Purchase Invoice",
"print_hide": 1,
"read_only": 1
},
{
"allow_on_submit": 1,
"doctype": "DocField",
@@ -749,19 +745,6 @@
"fieldtype": "Column Break",
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "company",
"fieldtype": "Link",
"in_filter": 1,
"label": "Company",
"oldfieldname": "company",
"oldfieldtype": "Link",
"options": "Company",
"print_hide": 1,
"read_only": 0,
"search_index": 1
},
{
"doctype": "DocField",
"fieldname": "fiscal_year",

View File

@@ -1,8 +1,8 @@
[
{
"creation": "2013-04-19 11:00:07",
"creation": "2013-05-22 12:43:10",
"docstatus": 0,
"modified": "2013-05-22 12:01:56",
"modified": "2013-07-09 12:21:47",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -86,7 +86,7 @@
"doctype": "DocField",
"fieldname": "import_ref_rate",
"fieldtype": "Currency",
"label": "Ref Rate ",
"label": "Price List Rate",
"options": "currency",
"print_hide": 1,
"read_only": 0
@@ -126,7 +126,7 @@
"doctype": "DocField",
"fieldname": "purchase_ref_rate",
"fieldtype": "Currency",
"label": "Ref Rate*",
"label": "Price List Rate (Company Currency)",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 0
@@ -135,7 +135,7 @@
"doctype": "DocField",
"fieldname": "rate",
"fieldtype": "Currency",
"label": "Rate*",
"label": "Rate (Company Currency)",
"oldfieldname": "rate",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -147,7 +147,7 @@
"doctype": "DocField",
"fieldname": "amount",
"fieldtype": "Currency",
"label": "Amount*",
"label": "Amount (Company Currency)",
"oldfieldname": "amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -223,7 +223,7 @@
"fieldname": "purchase_order",
"fieldtype": "Link",
"in_filter": 1,
"label": "Pur Order",
"label": "Purchase Order",
"no_copy": 1,
"oldfieldname": "purchase_order",
"oldfieldtype": "Link",
@@ -251,7 +251,7 @@
"fieldname": "purchase_receipt",
"fieldtype": "Link",
"in_filter": 1,
"label": "Pur Receipt",
"label": "Purchase Receipt",
"no_copy": 1,
"oldfieldname": "purchase_receipt",
"oldfieldtype": "Link",

View File

@@ -149,7 +149,6 @@ cur_frm.fields_dict['purchase_tax_details'].grid.get_field("cost_center").get_qu
}
}
cur_frm.cscript.account_head = function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
if(!d.charge_type && d.account_head){

View File

@@ -287,6 +287,7 @@ cur_frm.fields_dict.write_off_account.get_query = function(doc) {
// Write off cost center
//-----------------------
cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) {
return{
filters:{
'group_or_ledger': 'Ledger',

View File

@@ -93,6 +93,7 @@ class DocType(SellingController):
self.validate_c_form()
self.validate_time_logs_are_submitted()
self.validate_recurring_invoice()
self.validate_multiple_billing("Delivered Note", "dn_detail", "export_amount")
def on_submit(self):
if cint(self.doc.update_stock) == 1:
@@ -149,7 +150,7 @@ class DocType(SellingController):
self.make_cancel_gl_entries()
def update_status_updater_args(self):
if cint(self.doc.is_pos) and cint(self.doc.update_stock):
if cint(self.doc.update_stock):
self.status_updater.append({
'source_dt':'Sales Invoice Item',
'target_dt':'Sales Order Item',

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-05-24 19:29:05",
"docstatus": 0,
"modified": "2013-07-08 17:05:43",
"modified": "2013-07-09 12:48:05",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -223,7 +223,7 @@
"doctype": "DocField",
"fieldname": "currency_section",
"fieldtype": "Section Break",
"label": "Price List and Currency",
"label": "Currency and Price List",
"options": "icon-tag",
"read_only": 0
},
@@ -350,20 +350,30 @@
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "section_break_30",
"fieldtype": "Section Break"
},
{
"doctype": "DocField",
"fieldname": "net_total_export",
"fieldtype": "Currency",
"label": "Net Total (Export)",
"label": "Net Total",
"options": "currency",
"print_hide": 0,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "column_break_32",
"fieldtype": "Column Break"
},
{
"doctype": "DocField",
"fieldname": "net_total",
"fieldtype": "Currency",
"label": "Net Total*",
"label": "Net Total (Company Currency)",
"oldfieldname": "net_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -371,15 +381,6 @@
"read_only": 1,
"reqd": 1
},
{
"doctype": "DocField",
"fieldname": "recalculate_values",
"fieldtype": "Button",
"label": "Re-Calculate Values",
"oldfieldtype": "Button",
"print_hide": 1,
"read_only": 0
},
{
"doctype": "DocField",
"fieldname": "taxes",
@@ -449,19 +450,8 @@
"doctype": "DocField",
"fieldname": "other_charges_total_export",
"fieldtype": "Currency",
"label": "Total Taxes and Charges (Export)",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "other_charges_total",
"fieldtype": "Currency",
"label": "Total Taxes and Charges",
"oldfieldname": "other_charges_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"options": "currency",
"print_hide": 1,
"read_only": 1
},
@@ -472,12 +462,14 @@
},
{
"doctype": "DocField",
"fieldname": "calculate_charges",
"fieldtype": "Button",
"label": "Calculate Taxes and Charges",
"oldfieldtype": "Button",
"fieldname": "other_charges_total",
"fieldtype": "Currency",
"label": "Total Taxes and Charges (Company Currency)",
"oldfieldname": "other_charges_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
"print_hide": 1,
"read_only": 0
"read_only": 1
},
{
"doctype": "DocField",
@@ -494,7 +486,7 @@
"fieldname": "grand_total_export",
"fieldtype": "Currency",
"in_list_view": 1,
"label": "Grand Total (Export)",
"label": "Grand Total",
"oldfieldname": "grand_total_export",
"oldfieldtype": "Currency",
"options": "currency",
@@ -506,7 +498,7 @@
"doctype": "DocField",
"fieldname": "rounded_total_export",
"fieldtype": "Currency",
"label": "Rounded Total (Export)",
"label": "Rounded Total",
"oldfieldname": "rounded_total_export",
"oldfieldtype": "Currency",
"options": "currency",
@@ -517,7 +509,7 @@
"doctype": "DocField",
"fieldname": "in_words_export",
"fieldtype": "Data",
"label": "In Words (Export)",
"label": "In Words",
"oldfieldname": "in_words_export",
"oldfieldtype": "Data",
"print_hide": 0,
@@ -558,7 +550,7 @@
"fieldname": "grand_total",
"fieldtype": "Currency",
"in_filter": 1,
"label": "Grand Total",
"label": "Grand Total (Company Currency)",
"oldfieldname": "grand_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -571,7 +563,7 @@
"doctype": "DocField",
"fieldname": "rounded_total",
"fieldtype": "Currency",
"label": "Rounded Total",
"label": "Rounded Total (Company Currency)",
"oldfieldname": "rounded_total",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -583,7 +575,7 @@
"doctype": "DocField",
"fieldname": "in_words",
"fieldtype": "Data",
"label": "In Words",
"label": "In Words (Company Currency)",
"oldfieldname": "in_words",
"oldfieldtype": "Data",
"print_hide": 1,
@@ -645,6 +637,7 @@
"read_only": 0
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "payments_section",
"fieldtype": "Section Break",
@@ -653,6 +646,7 @@
"read_only": 0
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "column_break3",
"fieldtype": "Column Break",
@@ -660,6 +654,7 @@
"width": "50%"
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "paid_amount",
"fieldtype": "Currency",
@@ -671,6 +666,7 @@
"read_only": 0
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "cash_bank_account",
"fieldtype": "Link",
@@ -682,6 +678,7 @@
"read_only": 0
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "column_break4",
"fieldtype": "Column Break",
@@ -689,6 +686,7 @@
"width": "50%"
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "write_off_outstanding_amount_automatically",
"fieldtype": "Check",
@@ -697,6 +695,7 @@
"read_only": 0
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "write_off_amount",
"fieldtype": "Currency",
@@ -706,6 +705,7 @@
"read_only": 0
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "write_off_account",
"fieldtype": "Link",
@@ -715,6 +715,7 @@
"read_only": 0
},
{
"depends_on": "is_pos",
"doctype": "DocField",
"fieldname": "write_off_cost_center",
"fieldtype": "Link",

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-06-04 11:02:19",
"docstatus": 0,
"modified": "2013-06-26 14:34:00",
"modified": "2013-07-09 12:46:12",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -85,7 +85,7 @@
"doctype": "DocField",
"fieldname": "qty",
"fieldtype": "Float",
"label": "Qty",
"label": "Quantity",
"oldfieldname": "qty",
"oldfieldtype": "Currency",
"read_only": 0,
@@ -146,7 +146,7 @@
"doctype": "DocField",
"fieldname": "base_ref_rate",
"fieldtype": "Currency",
"label": "Price List Rate*",
"label": "Price List Rate (Company Currency)",
"oldfieldname": "base_ref_rate",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -158,7 +158,7 @@
"fieldname": "basic_rate",
"fieldtype": "Currency",
"in_filter": 0,
"label": "Basic Rate*",
"label": "Basic Rate (Company Currency)",
"oldfieldname": "basic_rate",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -171,7 +171,7 @@
"doctype": "DocField",
"fieldname": "amount",
"fieldtype": "Currency",
"label": "Amount*",
"label": "Amount (Company Currency)",
"oldfieldname": "amount",
"oldfieldtype": "Currency",
"options": "Company:company:default_currency",
@@ -320,7 +320,7 @@
"fieldtype": "Data",
"hidden": 1,
"in_filter": 1,
"label": "SO Detail ",
"label": "Sales Order Item",
"no_copy": 1,
"oldfieldname": "so_detail",
"oldfieldtype": "Data",
@@ -348,7 +348,7 @@
"fieldtype": "Data",
"hidden": 1,
"in_filter": 1,
"label": "DN Detail",
"label": "Delivery Note Item",
"no_copy": 1,
"oldfieldname": "dn_detail",
"oldfieldtype": "Data",
@@ -375,18 +375,6 @@
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "clear_pending",
"fieldtype": "Check",
"hidden": 1,
"label": "Clear Pending",
"no_copy": 1,
"oldfieldname": "clear_pending",
"oldfieldtype": "Check",
"print_hide": 1,
"read_only": 1
},
{
"doctype": "DocField",
"fieldname": "buying_amount",

View File

@@ -310,7 +310,7 @@ erpnext.AccountsChart = Class.extend({
var node = me.selected_node();
v.parent_cost_center = node.data('label');
v.company_name = me.company;
v.company = me.company;
wn.call({
args: v,

View File

@@ -28,16 +28,14 @@ def get_children():
args = webnotes.form_dict
ctype, company = args['ctype'], args['comp']
company_field = ctype=='Account' and 'company' or 'company_name'
# root
if args['parent'] in ("Accounts", "Cost Centers"):
acc = webnotes.conn.sql(""" select
name as value, if(group_or_ledger='Group', 1, 0) as expandable
from `tab%s`
where ifnull(parent_%s,'') = ''
and %s = %s and docstatus<2
order by name""" % (ctype, ctype.lower().replace(' ','_'), company_field, '%s'),
and `company` = %s and docstatus<2
order by name""" % (ctype, ctype.lower().replace(' ','_'), '%s'),
company, as_dict=1)
else:
# other

View File

@@ -79,7 +79,7 @@ def get_costcenter_target_details(filters):
cc.parent_cost_center, bd.account, bd.budget_allocated
from `tabCost Center` cc, `tabBudget Detail` bd
where bd.parent=cc.name and bd.fiscal_year=%s and
cc.company_name=%s and ifnull(cc.distribution_id, '')!=''
cc.company=%s and ifnull(cc.distribution_id, '')!=''
order by cc.name""" % ('%s', '%s'),
(filters.get("fiscal_year"), filters.get("company")), as_dict=1)