Multiple fixes
This commit is contained in:
parent
d49a123fd0
commit
e8500ad4e6
@ -65,6 +65,22 @@
|
||||
"reqd": 1,
|
||||
"search_index": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "root_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Root Type",
|
||||
"options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
|
||||
"permlevel": 0,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "report_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Report Type",
|
||||
"options": "\nBalance Sheet\nProfit and Loss",
|
||||
"permlevel": 0,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "column_break1",
|
||||
"fieldtype": "Column Break",
|
||||
@ -130,22 +146,6 @@
|
||||
"options": "\nDebit\nCredit",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "root_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Root Type",
|
||||
"options": "\nAsset\nLiability\nIncome\nExpense\nEquity",
|
||||
"permlevel": 0,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "report_type",
|
||||
"fieldtype": "Select",
|
||||
"label": "Report Type",
|
||||
"options": "\nBalance Sheet\nProfit and Loss",
|
||||
"permlevel": 0,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "lft",
|
||||
"fieldtype": "Int",
|
||||
@ -177,7 +177,7 @@
|
||||
"icon": "icon-money",
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"modified": "2015-01-01 15:36:43.219662",
|
||||
"modified": "2015-01-05 11:03:07.861934",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Accounts",
|
||||
"name": "Account",
|
||||
|
@ -22,7 +22,9 @@ coa = {
|
||||
},
|
||||
"account_type": "Cash"
|
||||
},
|
||||
_("Loans and Advances (Assets)"): {},
|
||||
_("Loans and Advances (Assets)"): {
|
||||
"group_or_ledger": "Group"
|
||||
},
|
||||
_("Securities and Deposits"): {
|
||||
_("Earnest Money"): {}
|
||||
},
|
||||
|
@ -74,9 +74,9 @@ def get_costcenter_target_details(filters):
|
||||
def get_target_distribution_details(filters):
|
||||
target_details = {}
|
||||
|
||||
for d in frappe.db.sql("""select bd.name, bdd.month, bdd.percentage_allocation
|
||||
from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd
|
||||
where bdd.parent=bd.name and bd.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
|
||||
for d in frappe.db.sql("""select md.name, mdp.month, mdp.percentage_allocation
|
||||
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
|
||||
where mdp.parent=md.name and md.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
|
||||
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
|
||||
|
||||
return target_details
|
||||
|
@ -309,9 +309,9 @@ def validate_expense_against_budget(args):
|
||||
def get_allocated_budget(distribution_id, posting_date, fiscal_year, yearly_budget):
|
||||
if distribution_id:
|
||||
distribution = {}
|
||||
for d in frappe.db.sql("""select bdd.month, bdd.percentage_allocation
|
||||
from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd
|
||||
where bdd.parent=bd.name and bd.fiscal_year=%s""", fiscal_year, as_dict=1):
|
||||
for d in frappe.db.sql("""select mdp.month, mdp.percentage_allocation
|
||||
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
|
||||
where mdp.parent=md.name and md.fiscal_year=%s""", fiscal_year, as_dict=1):
|
||||
distribution.setdefault(d.month, d.percentage_allocation)
|
||||
|
||||
dt = frappe.db.get_value("Fiscal Year", fiscal_year, "year_start_date")
|
||||
|
@ -104,19 +104,6 @@
|
||||
"options": "icon-file-text",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Enter the company name under which Account Head will be created for this Supplier",
|
||||
"fieldname": "company",
|
||||
"fieldtype": "Link",
|
||||
"in_filter": 1,
|
||||
"label": "Company",
|
||||
"oldfieldname": "company",
|
||||
"oldfieldtype": "Link",
|
||||
"options": "Company",
|
||||
"permlevel": 0,
|
||||
"reqd": 1,
|
||||
"search_index": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "default_currency",
|
||||
"fieldtype": "Link",
|
||||
|
@ -139,7 +139,7 @@ def get_data():
|
||||
{
|
||||
"type":"doctype",
|
||||
"name": "Monthly Distribution",
|
||||
"description": _("Seasonality for setting budgets.")
|
||||
"description": _("Seasonality for setting budgets, targets etc.")
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
|
@ -220,6 +220,9 @@ rename_map = {
|
||||
],
|
||||
"Journal Entry": [
|
||||
["entries", "accounts"]
|
||||
],
|
||||
"Monthly Distribution": [
|
||||
["budget_distribution_details", "percentages"]
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -71,9 +71,9 @@ def get_salesperson_details(filters):
|
||||
def get_target_distribution_details(filters):
|
||||
target_details = {}
|
||||
|
||||
for d in frappe.db.sql("""select bd.name, bdd.month, bdd.percentage_allocation
|
||||
from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd
|
||||
where bdd.parent=bd.name and bd.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
|
||||
for d in frappe.db.sql("""select md.name, mdp.month, mdp.percentage_allocation
|
||||
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` mdp
|
||||
where mdp.parent=md.name and md.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
|
||||
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
|
||||
|
||||
return target_details
|
||||
|
@ -70,9 +70,9 @@ def get_territory_details(filters):
|
||||
def get_target_distribution_details(filters):
|
||||
target_details = {}
|
||||
|
||||
for d in frappe.db.sql("""select bd.name, bdd.month, bdd.percentage_allocation
|
||||
from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd
|
||||
where bdd.parent=bd.name and bd.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
|
||||
for d in frappe.db.sql("""select md.name, mdp.month, mdp.percentage_allocation
|
||||
from `tabMonthly Distribution Percentage` mdp, `tabMonthly Distribution` md
|
||||
where mdp.parent=md.name and md.fiscal_year=%s""", (filters["fiscal_year"]), as_dict=1):
|
||||
target_details.setdefault(d.name, {}).setdefault(d.month, flt(d.percentage_allocation))
|
||||
|
||||
return target_details
|
||||
|
@ -107,6 +107,7 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"fieldname": "default_cash_account",
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
@ -143,6 +144,7 @@
|
||||
"read_only": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"fieldname": "default_expense_account",
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
@ -152,6 +154,7 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "eval:!doc.__islocal",
|
||||
"fieldname": "default_income_account",
|
||||
"fieldtype": "Link",
|
||||
"ignore_user_permissions": 1,
|
||||
@ -372,7 +375,7 @@
|
||||
],
|
||||
"icon": "icon-building",
|
||||
"idx": 1,
|
||||
"modified": "2014-12-15 11:14:12.090020",
|
||||
"modified": "2015-01-05 11:30:45.716971",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Company",
|
||||
|
@ -168,6 +168,12 @@ class Company(Document):
|
||||
#delete cost center
|
||||
frappe.db.sql("delete from `tabCost Center` WHERE company = %s order by lft desc, rgt desc", self.name)
|
||||
|
||||
# delete account from customer and supplier
|
||||
frappe.db.sql("delete from `tabParty Account` where company=%s", self.name)
|
||||
|
||||
# delete email digest
|
||||
frappe.db.sql("delete from `tabEmail Digest` where company=%s", self.name)
|
||||
|
||||
if not frappe.db.get_value("Stock Ledger Entry", {"company": self.name}):
|
||||
frappe.db.sql("""delete from `tabWarehouse` where company=%s""", self.name)
|
||||
|
||||
|
@ -314,10 +314,10 @@ def create_items(args):
|
||||
is_stock_item = item_group!=_("Services")
|
||||
default_warehouse = ""
|
||||
if is_stock_item:
|
||||
if is_sales_item:
|
||||
default_warehouse = _("Finished Goods") + " - " + args.get("company_abbr")
|
||||
else:
|
||||
default_warehouse = _("Stores") + " - " + args.get("company_abbr")
|
||||
default_warehouse = frappe.db.get_value("Warehouse", filters={
|
||||
"warehouse_name": _("Finished Goods") if is_sales_item else _("Stores"),
|
||||
"company": args.get("company_name").strip()
|
||||
})
|
||||
|
||||
frappe.get_doc({
|
||||
"doctype":"Item",
|
||||
|
@ -79,7 +79,7 @@ class Item(WebsiteGenerator):
|
||||
return context
|
||||
|
||||
def check_warehouse_is_set_for_stock_item(self):
|
||||
if self.is_stock_item=="Yes" and not self.default_warehouse:
|
||||
if self.is_stock_item=="Yes" and not self.default_warehouse and frappe.get_all("Warehouse"):
|
||||
frappe.msgprint(_("Default Warehouse is mandatory for stock Item."),
|
||||
raise_exception=WarehouseNotSet)
|
||||
|
||||
|
@ -18,17 +18,6 @@
|
||||
"permlevel": 0,
|
||||
"width": "50%"
|
||||
},
|
||||
{
|
||||
"fieldname": "account",
|
||||
"fieldtype": "Link",
|
||||
"in_list_view": 1,
|
||||
"label": "Account",
|
||||
"options": "Account",
|
||||
"permlevel": 0,
|
||||
"print_hide": 1,
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "amount",
|
||||
"fieldtype": "Currency",
|
||||
@ -40,7 +29,7 @@
|
||||
}
|
||||
],
|
||||
"istable": 1,
|
||||
"modified": "2014-08-08 13:12:02.594698",
|
||||
"modified": "2015-01-10 11:32:46.466371",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Stock",
|
||||
"name": "Landed Cost Taxes and Charges",
|
||||
|
@ -19,17 +19,6 @@ erpnext.stock.LandedCostVoucher = erpnext.stock.StockController.extend({
|
||||
}
|
||||
};
|
||||
|
||||
this.frm.fields_dict.taxes.grid.get_field('account').get_query = function() {
|
||||
if(!me.frm.doc.company) msgprint(__("Please enter company first"));
|
||||
return {
|
||||
filters:[
|
||||
['Account', 'group_or_ledger', '=', 'Ledger'],
|
||||
['Account', 'account_type', 'in', ['Tax', 'Chargeable', 'Expense Account']],
|
||||
['Account', 'company', '=', me.frm.doc.company]
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
this.frm.add_fetch("purchase_receipt", "supplier", "supplier");
|
||||
this.frm.add_fetch("purchase_receipt", "posting_date", "posting_date");
|
||||
this.frm.add_fetch("purchase_receipt", "grand_total", "grand_total");
|
||||
|
Loading…
x
Reference in New Issue
Block a user