Merge branch 'develop'

This commit is contained in:
Anand Doshi 2015-08-17 14:36:48 +05:30
commit 41793bddd2
9 changed files with 34 additions and 30 deletions

View File

@ -1,2 +1,2 @@
from __future__ import unicode_literals
__version__ = '5.6.3'
__version__ = '5.6.4'

View File

@ -39,7 +39,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 1,
"in_list_view": 0,
"label": "Account Balance",
"no_copy": 1,
"oldfieldname": "balance",
@ -63,7 +63,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 1,
"in_list_view": 1,
"in_list_view": 0,
"label": "Cost Center",
"no_copy": 0,
"oldfieldname": "cost_center",
@ -125,7 +125,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Party",
"no_copy": 0,
"options": "party_type",
@ -287,7 +287,7 @@
"hidden": 0,
"ignore_user_permissions": 0,
"in_filter": 0,
"in_list_view": 0,
"in_list_view": 1,
"label": "Reference Name",
"no_copy": 0,
"options": "reference_type",
@ -371,7 +371,7 @@
"is_submittable": 0,
"issingle": 0,
"istable": 1,
"modified": "2015-08-11 10:44:11.432623",
"modified": "2015-08-17 02:11:33.991361",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Journal Entry Account",

View File

@ -100,14 +100,15 @@ def get_balance_on(account=None, date=None, party_type=None, party=None):
if party_type and party:
cond.append("""gle.party_type = "%s" and gle.party = "%s" """ %
(party_type.replace('"', '\\"'), party.replace('"', '\\"')))
if account or (party_type and party):
bal = frappe.db.sql("""
SELECT sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
FROM `tabGL Entry` gle
WHERE %s""" % " and ".join(cond))[0][0]
bal = frappe.db.sql("""
SELECT sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))
FROM `tabGL Entry` gle
WHERE %s""" % " and ".join(cond))[0][0]
# if bal is None, return 0
return flt(bal)
# if bal is None, return 0
return flt(bal)
@frappe.whitelist()
def add_ac(args=None):

View File

@ -27,7 +27,7 @@ blogs.
"""
app_icon = "icon-th"
app_color = "#e74c3c"
app_version = "5.6.3"
app_version = "5.6.4"
github_link = "https://github.com/frappe/erpnext"
error_report_email = "support@erpnext.com"

View File

@ -99,7 +99,6 @@ execute:frappe.db.sql("update `tabMaterial Request` set material_request_type =
execute:frappe.reload_doc('stock', 'doctype', 'item')
execute:frappe.db.sql("update `tabItem` i set apply_warehouse_wise_reorder_level=1, re_order_level=0, re_order_qty=0 where exists(select name from `tabItem Reorder` where parent=i.name)")
erpnext.patches.v5_0.set_default_company_in_bom
erpnext.patches.v5_0.capacity_planning
execute:frappe.reload_doc('crm', 'doctype', 'lead')
execute:frappe.reload_doc('crm', 'doctype', 'opportunity')
erpnext.patches.v5_0.rename_taxes_and_charges_master

View File

@ -1,9 +0,0 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
frappe.reload_doc("stock", "doctype", "stock_entry")
if "total_fixed_cost" in frappe.db.get_table_columns("Stock Entry"):
frappe.db.sql("update `tabStock Entry` set additional_operating_cost = total_fixed_cost")

View File

@ -16,15 +16,24 @@ def execute():
and (se.purpose not in ('Manufacture', 'Repack') or ifnull(additional_operating_cost, 0)=0)
""")
stock_entry_db_columns = frappe.db.get_table_columns("Stock Entry")
if "additional_operating_cost" in stock_entry_db_columns:
operating_cost_fieldname = "additional_operating_cost"
elif "total_fixed_cost" in stock_entry_db_columns:
operating_cost_fieldname = "total_fixed_cost"
else:
return
stock_entries = frappe.db.sql_list("""select name from `tabStock Entry`
where purpose in ('Manufacture', 'Repack') and ifnull(additional_operating_cost, 0)!=0
and docstatus < 2""")
where purpose in ('Manufacture', 'Repack') and ifnull({0}, 0)!=0
and docstatus < 2""".format(operating_cost_fieldname))
for d in stock_entries:
stock_entry = frappe.get_doc("Stock Entry", d)
stock_entry.append("additional_costs", {
"description": "Additional Operating Cost",
"amount": stock_entry.additional_operating_cost
"amount": stock_entry.get(operating_cost_fieldname)
})
number_of_fg_items = len([t.t_warehouse for t in stock_entry.get("items") if t.t_warehouse])
@ -33,7 +42,7 @@ def execute():
d.valuation_rate = d.incoming_rate
if d.bom_no or (d.t_warehouse and number_of_fg_items == 1):
d.additional_cost = stock_entry.additional_operating_cost
d.additional_cost = stock_entry.get(operating_cost_fieldname)
d.basic_rate = flt(d.valuation_rate) - flt(d.additional_cost)
d.basic_amount = flt(flt(d.basic_rate) *flt(d.transfer_qty), d.precision("basic_amount"))

View File

@ -231,6 +231,10 @@ class StockEntry(StockController):
frappe.throw(_("""Row {0}: Qty not avalable in warehouse {1} on {2} {3}.
Available Qty: {4}, Transfer Qty: {5}""").format(d.idx, d.s_warehouse,
self.posting_date, self.posting_time, d.actual_qty, d.transfer_qty), NegativeStockError)
def get_stock_and_rate(self):
self.set_actual_qty()
self.calculate_rate_and_amount()
def calculate_rate_and_amount(self, force=False):
self.set_basic_rate(force)
@ -273,7 +277,7 @@ class StockEntry(StockController):
for d in self.get("items"):
if d.bom_no or (d.t_warehouse and number_of_fg_items == 1):
d.basic_rate = flt(raw_material_cost / flt(d.transfer_qty), d.precision("basic_rate"))
d.basic_amount = flt(flt(d.basic_rate) * flt(d.transfer_qty), d.precision("basic_amount"))
d.basic_amount = flt(raw_material_cost, d.precision("basic_amount"))
def distribute_additional_costs(self):
if self.purpose == "Material Issue":

View File

@ -1,6 +1,6 @@
from setuptools import setup, find_packages
version = "5.6.3"
version = "5.6.4"
with open("requirements.txt", "r") as f:
install_requires = f.readlines()