Merge pull request #7988 from nabinhait/develop
Multiple version 8 fixes
This commit is contained in:
commit
0afbee9441
@ -117,7 +117,7 @@ def get_charts_for_country(country):
|
|||||||
|
|
||||||
def get_account_tree_from_existing_company(existing_company):
|
def get_account_tree_from_existing_company(existing_company):
|
||||||
all_accounts = frappe.get_all('Account',
|
all_accounts = frappe.get_all('Account',
|
||||||
filters={'company': existing_company},
|
filters={'company': existing_company, "warehouse": ""},
|
||||||
fields = ["name", "account_name", "parent_account", "account_type",
|
fields = ["name", "account_name", "parent_account", "account_type",
|
||||||
"is_group", "root_type", "tax_rate"],
|
"is_group", "root_type", "tax_rate"],
|
||||||
order_by="lft, rgt")
|
order_by="lft, rgt")
|
||||||
@ -126,7 +126,6 @@ def get_account_tree_from_existing_company(existing_company):
|
|||||||
|
|
||||||
# fill in tree starting with root accounts (those with no parent)
|
# fill in tree starting with root accounts (those with no parent)
|
||||||
build_account_tree(account_tree, None, all_accounts)
|
build_account_tree(account_tree, None, all_accounts)
|
||||||
|
|
||||||
return account_tree
|
return account_tree
|
||||||
|
|
||||||
def build_account_tree(tree, parent, all_accounts):
|
def build_account_tree(tree, parent, all_accounts):
|
||||||
|
|||||||
@ -88,10 +88,7 @@
|
|||||||
"Items Delivered to Customs on temprary Base": {}
|
"Items Delivered to Customs on temprary Base": {}
|
||||||
},
|
},
|
||||||
"Stock in Hand": {
|
"Stock in Hand": {
|
||||||
"All Warehouses": {
|
"is_group": 1,
|
||||||
"account_type": "Stock",
|
|
||||||
"is_group": 1
|
|
||||||
},
|
|
||||||
"account_type": "Stock"
|
"account_type": "Stock"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -40,10 +40,7 @@
|
|||||||
"Rental Deposits": {}
|
"Rental Deposits": {}
|
||||||
},
|
},
|
||||||
"Stock Assets": {
|
"Stock Assets": {
|
||||||
"All Warehouses": {
|
"is_group": 1,
|
||||||
"account_type": "Stock",
|
|
||||||
"is_group": 1
|
|
||||||
},
|
|
||||||
"account_type": "Stock"
|
"account_type": "Stock"
|
||||||
},
|
},
|
||||||
"Tax Assets": {
|
"Tax Assets": {
|
||||||
|
|||||||
@ -684,6 +684,7 @@ def get_payment_entry(dt, dn, party_amount=None, bank_account=None, bank_amount=
|
|||||||
pe.paid_amount = paid_amount
|
pe.paid_amount = paid_amount
|
||||||
pe.received_amount = received_amount
|
pe.received_amount = received_amount
|
||||||
pe.allocate_payment_amount = 1
|
pe.allocate_payment_amount = 1
|
||||||
|
pe.letter_head = doc.get("letter_head")
|
||||||
|
|
||||||
pe.append("references", {
|
pe.append("references", {
|
||||||
"reference_doctype": dt,
|
"reference_doctype": dt,
|
||||||
|
|||||||
@ -248,21 +248,31 @@ class GrossProfitGenerator(object):
|
|||||||
conditions += " and posting_date >= %(from_date)s"
|
conditions += " and posting_date >= %(from_date)s"
|
||||||
if self.filters.to_date:
|
if self.filters.to_date:
|
||||||
conditions += " and posting_date <= %(to_date)s"
|
conditions += " and posting_date <= %(to_date)s"
|
||||||
|
|
||||||
|
if self.filters.group_by=="Sales Person":
|
||||||
|
sales_person_cols = ", sales.sales_person, sales.allocated_amount, sales.incentives"
|
||||||
|
sales_team_table = "left join `tabSales Team` sales on sales.parent = si.name"
|
||||||
|
else:
|
||||||
|
sales_person_cols = ""
|
||||||
|
sales_team_table = ""
|
||||||
|
|
||||||
self.si_list = frappe.db.sql("""select item.parenttype, item.parent,
|
self.si_list = frappe.db.sql("""select item.parenttype, item.parent,
|
||||||
si.posting_date, si.posting_time, si.project, si.update_stock,
|
si.posting_date, si.posting_time, si.project, si.update_stock,
|
||||||
si.customer, si.customer_group, si.territory,
|
si.customer, si.customer_group, si.territory,
|
||||||
item.item_code, item.item_name, item.description, item.warehouse,
|
item.item_code, item.item_name, item.description, item.warehouse,
|
||||||
item.item_group, item.brand, item.dn_detail, item.delivery_note,
|
item.item_group, item.brand, item.dn_detail, item.delivery_note,
|
||||||
item.stock_qty as qty, item.base_net_rate, item.base_net_amount, item.name as "item_row",
|
item.stock_qty as qty, item.base_net_rate, item.base_net_amount, item.name as "item_row"
|
||||||
sales.sales_person, sales.allocated_amount, sales.incentives
|
{sales_person_cols}
|
||||||
from `tabSales Invoice` si
|
from
|
||||||
inner join `tabSales Invoice Item` item on item.parent = si.name
|
`tabSales Invoice` si
|
||||||
left join `tabSales Team` sales on sales.parent = si.name
|
inner join `tabSales Invoice Item` item on item.parent = si.name
|
||||||
|
{sales_team_table}
|
||||||
where
|
where
|
||||||
si.docstatus = 1 and si.is_return != 1 %s
|
si.docstatus = 1 and si.is_return != 1 {conditions}
|
||||||
order by
|
order by
|
||||||
si.posting_date desc, si.posting_time desc""" % (conditions,), self.filters, as_dict=1)
|
si.posting_date desc, si.posting_time desc"""
|
||||||
|
.format(conditions=conditions, sales_person_cols=sales_person_cols,
|
||||||
|
sales_team_table=sales_team_table), self.filters, as_dict=1)
|
||||||
|
|
||||||
def load_stock_ledger_entries(self):
|
def load_stock_ledger_entries(self):
|
||||||
res = frappe.db.sql("""select item_code, voucher_type, voucher_no,
|
res = frappe.db.sql("""select item_code, voucher_type, voucher_no,
|
||||||
|
|||||||
@ -178,6 +178,7 @@ def get_item_details(item_code):
|
|||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def make_quotation(source_name, target_doc=None):
|
def make_quotation(source_name, target_doc=None):
|
||||||
def set_missing_values(source, target):
|
def set_missing_values(source, target):
|
||||||
|
from erpnext.controllers.accounts_controller import get_default_taxes_and_charges
|
||||||
quotation = frappe.get_doc(target)
|
quotation = frappe.get_doc(target)
|
||||||
|
|
||||||
company_currency = frappe.db.get_value("Company", quotation.company, "default_currency")
|
company_currency = frappe.db.get_value("Company", quotation.company, "default_currency")
|
||||||
@ -193,7 +194,11 @@ def make_quotation(source_name, target_doc=None):
|
|||||||
quotation.transaction_date)
|
quotation.transaction_date)
|
||||||
|
|
||||||
quotation.conversion_rate = exchange_rate
|
quotation.conversion_rate = exchange_rate
|
||||||
|
|
||||||
|
# get default taxes
|
||||||
|
taxes = get_default_taxes_and_charges("Sales Taxes and Charges Template")
|
||||||
|
quotation.extend("taxes", taxes)
|
||||||
|
|
||||||
quotation.run_method("set_missing_values")
|
quotation.run_method("set_missing_values")
|
||||||
quotation.run_method("calculate_taxes_and_totals")
|
quotation.run_method("calculate_taxes_and_totals")
|
||||||
|
|
||||||
|
|||||||
@ -148,8 +148,10 @@ class ProcessPayroll(Document):
|
|||||||
ss_obj = frappe.get_doc("Salary Slip",ss[0])
|
ss_obj = frappe.get_doc("Salary Slip",ss[0])
|
||||||
ss_dict = {}
|
ss_dict = {}
|
||||||
ss_dict["Employee Name"] = ss_obj.employee_name
|
ss_dict["Employee Name"] = ss_obj.employee_name
|
||||||
ss_dict["Total Pay"] = fmt_money(ss_obj.rounded_total,currency = frappe.defaults.get_global_default("currency"))
|
ss_dict["Total Pay"] = fmt_money(ss_obj.net_pay,
|
||||||
|
currency = frappe.defaults.get_global_default("currency"))
|
||||||
ss_dict["Salary Slip"] = self.format_as_links(ss_obj.name)[0]
|
ss_dict["Salary Slip"] = self.format_as_links(ss_obj.name)[0]
|
||||||
|
|
||||||
if ss_obj.net_pay<0:
|
if ss_obj.net_pay<0:
|
||||||
not_submitted_ss.append(ss_dict)
|
not_submitted_ss.append(ss_dict)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -1,6 +1,17 @@
|
|||||||
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
|
||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
|
frappe.ui.form.on('Student', {
|
||||||
|
setup: function(frm) {
|
||||||
|
frm.set_query("student", "siblings", function(doc, cdt, cdn) {
|
||||||
|
return {
|
||||||
|
"filters": {
|
||||||
|
"name": ["!=", doc.name]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
frappe.ui.form.on("Student Guardian", {
|
frappe.ui.form.on("Student Guardian", {
|
||||||
guardian: function(frm) {
|
guardian: function(frm) {
|
||||||
|
|||||||
@ -31,7 +31,8 @@ frappe.ui.form.on("Company", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onload_post_render: function(frm) {
|
onload_post_render: function(frm) {
|
||||||
frm.get_field("delete_company_transactions").$input.addClass("btn-danger");
|
if(frm.get_field("delete_company_transactions").$input)
|
||||||
|
frm.get_field("delete_company_transactions").$input.addClass("btn-danger");
|
||||||
},
|
},
|
||||||
country: function(frm) {
|
country: function(frm) {
|
||||||
erpnext.company.set_chart_of_accounts_options(frm.doc);
|
erpnext.company.set_chart_of_accounts_options(frm.doc);
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"allow_copy": 0,
|
"allow_copy": 0,
|
||||||
|
"allow_guest_to_view": 0,
|
||||||
"allow_import": 1,
|
"allow_import": 1,
|
||||||
"allow_rename": 1,
|
"allow_rename": 1,
|
||||||
"autoname": "field:company_name",
|
"autoname": "field:company_name",
|
||||||
@ -407,7 +408,7 @@
|
|||||||
"label": "Create Chart Of Accounts Based On",
|
"label": "Create Chart Of Accounts Based On",
|
||||||
"length": 0,
|
"length": 0,
|
||||||
"no_copy": 0,
|
"no_copy": 0,
|
||||||
"options": "Standard Template\nExisting Company",
|
"options": "\nStandard Template\nExisting Company",
|
||||||
"permlevel": 0,
|
"permlevel": 0,
|
||||||
"precision": "",
|
"precision": "",
|
||||||
"print_hide": 0,
|
"print_hide": 0,
|
||||||
@ -415,7 +416,7 @@
|
|||||||
"read_only": 0,
|
"read_only": 0,
|
||||||
"remember_last_selected_value": 0,
|
"remember_last_selected_value": 0,
|
||||||
"report_hide": 0,
|
"report_hide": 0,
|
||||||
"reqd": 0,
|
"reqd": 1,
|
||||||
"search_index": 0,
|
"search_index": 0,
|
||||||
"set_only_once": 0,
|
"set_only_once": 0,
|
||||||
"unique": 0
|
"unique": 0
|
||||||
@ -1680,19 +1681,19 @@
|
|||||||
"unique": 0
|
"unique": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"has_web_view": 0,
|
||||||
"hide_heading": 0,
|
"hide_heading": 0,
|
||||||
"hide_toolbar": 0,
|
"hide_toolbar": 0,
|
||||||
"icon": "fa fa-building",
|
"icon": "fa fa-building",
|
||||||
"idx": 1,
|
"idx": 1,
|
||||||
"image_view": 0,
|
"image_view": 0,
|
||||||
"in_create": 0,
|
"in_create": 0,
|
||||||
"in_dialog": 0,
|
|
||||||
"is_submittable": 0,
|
"is_submittable": 0,
|
||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"menu_index": 0,
|
"menu_index": 0,
|
||||||
"modified": "2017-03-02 15:24:52.908559",
|
"modified": "2017-03-12 15:50:23.099622",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Setup",
|
"module": "Setup",
|
||||||
"name": "Company",
|
"name": "Company",
|
||||||
@ -1846,4 +1847,4 @@
|
|||||||
"sort_order": "ASC",
|
"sort_order": "ASC",
|
||||||
"track_changes": 0,
|
"track_changes": 0,
|
||||||
"track_seen": 0
|
"track_seen": 0
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@ class TestCompany(unittest.TestCase):
|
|||||||
"root_type": "Asset",
|
"root_type": "Asset",
|
||||||
"parent_account": "Accounts Receivable - CFEC",
|
"parent_account": "Accounts Receivable - CFEC",
|
||||||
},
|
},
|
||||||
"_Test Cash - CFEC": {
|
"Cash - CFEC": {
|
||||||
"account_type": "Cash",
|
"account_type": "Cash",
|
||||||
"is_group": 0,
|
"is_group": 0,
|
||||||
"root_type": "Asset",
|
"root_type": "Asset",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user