Merge pull request #5671 from nabinhait/fixes90

Multiple fixes
This commit is contained in:
Nabin Hait 2016-07-06 16:53:31 +05:30 committed by GitHub
commit 70a1ddb6a1
6 changed files with 159 additions and 16 deletions

View File

@ -34,7 +34,7 @@ class BankReconciliation(Document):
t2.parent = t1.name and t2.account = %s and t1.docstatus=1
and t1.posting_date >= %s and t1.posting_date <= %s
and ifnull(t1.is_opening, 'No') = 'No' {0}
order by t1.posting_date DESC, t1.name DESC
order by t1.posting_date ASC, t1.name DESC
""".format(condition), (self.bank_account, self.from_date, self.to_date), as_dict=1)
payment_entries = frappe.db.sql("""
@ -48,7 +48,7 @@ class BankReconciliation(Document):
(paid_from=%s or paid_to=%s) and docstatus=1
and posting_date >= %s and posting_date <= %s {0}
order by
posting_date DESC, name DESC
posting_date ASC, name DESC
""".format(condition),
(self.bank_account, self.bank_account, self.bank_account, self.from_date, self.to_date), as_dict=1)

View File

@ -1091,7 +1091,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-06-23 10:20:22.075476",
"modified": "2016-07-06 16:09:38.879785",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order",
@ -1138,7 +1138,7 @@
"write": 0
}
],
"quick_entry": 1,
"quick_entry": 0,
"read_only": 0,
"read_only_onload": 0,
"sort_order": "ASC",

View File

@ -327,6 +327,32 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "eval:(doc.__islocal && doc.is_stock_item && doc.opening_stock)",
"fieldname": "valuation_rate",
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Valuation Rate",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 1,
@ -338,7 +364,7 @@
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Standard Rate",
"label": "Standard Selling Rate",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@ -352,6 +378,58 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "is_fixed_asset",
"fieldtype": "Check",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Is Fixed Asset",
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"depends_on": "is_fixed_asset",
"fieldname": "asset_category",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Asset Category",
"length": 0,
"no_copy": 0,
"options": "Asset Category",
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -2229,7 +2307,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 1,
"modified": "2016-06-27 17:41:38.336900",
"modified": "2016-07-06 16:00:45.561339",
"modified_by": "Administrator",
"module": "Stock",
"name": "Item",

View File

@ -118,6 +118,9 @@ class Item(WebsiteGenerator):
def set_opening_stock(self):
'''set opening stock'''
if not self.valuation_rate:
frappe.throw(_("Valuation Rate is mandatory if Opening Stock entered"))
from erpnext.stock.doctype.stock_entry.stock_entry_utils import make_stock_entry
# default warehouse, or Stores
@ -125,9 +128,8 @@ class Item(WebsiteGenerator):
or frappe.db.get_value('Warehouse', {'warehouse_name': _('Stores')}))
if default_warehouse:
stock_entry = make_stock_entry(item_code=self.name,
target=default_warehouse,
qty=self.opening_stock)
stock_entry = make_stock_entry(item_code=self.name, target=default_warehouse,
qty=self.opening_stock, rate=self.valuation_rate)
stock_entry.add_comment("Comment", _("Opening Stock"))

View File

@ -5,6 +5,8 @@ frappe.provide("erpnext.stock");
frappe.ui.form.on("Stock Reconciliation", {
onload: function(frm) {
frm.add_fetch("item_code", "item_name", "item_name");
// end of life
frm.set_query("item_code", "items", function(doc, cdt, cdn) {
return {

View File

@ -2,6 +2,7 @@
"allow_copy": 0,
"allow_import": 0,
"allow_rename": 0,
"beta": 0,
"creation": "2015-02-17 01:06:05.072764",
"custom": 0,
"docstatus": 0,
@ -16,6 +17,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Item Code",
@ -33,6 +35,31 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "item_name",
"fieldtype": "Data",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Item Name",
"length": 0,
"no_copy": 1,
"permlevel": 0,
"precision": "",
"print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 1,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -41,6 +68,7 @@
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Warehouse",
@ -62,10 +90,11 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "section_break_3",
"fieldtype": "Section Break",
"fieldname": "column_break_6",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@ -90,6 +119,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Quantity",
@ -115,6 +145,7 @@
"fieldtype": "Currency",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 1,
"label": "Valuation Rate",
@ -135,10 +166,11 @@
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_6",
"fieldtype": "Column Break",
"fieldname": "section_break_3",
"fieldtype": "Section Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
@ -163,6 +195,7 @@
"fieldtype": "Float",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Current Qty",
@ -179,6 +212,30 @@
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"fieldname": "column_break_9",
"fieldtype": "Column Break",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"length": 0,
"no_copy": 0,
"permlevel": 0,
"precision": "",
"print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0,
"report_hide": 0,
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
"unique": 0
},
{
"allow_on_submit": 0,
"bold": 0,
@ -188,6 +245,7 @@
"fieldtype": "Read Only",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_list_view": 0,
"label": "Current Valuation Rate",
@ -208,6 +266,7 @@
"hide_heading": 0,
"hide_toolbar": 0,
"idx": 0,
"image_view": 0,
"in_create": 0,
"in_dialog": 0,
"is_submittable": 0,
@ -215,15 +274,17 @@
"istable": 1,
"max_attachments": 0,
"menu_index": 0,
"modified": "2016-01-27 16:04:42.325454",
"modified": "2016-07-06 15:43:52.495428",
"modified_by": "Administrator",
"module": "Stock",
"name": "Stock Reconciliation Item",
"name_case": "",
"owner": "Administrator",
"permissions": [],
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"sort_field": "modified",
"sort_order": "DESC"
}
"sort_order": "DESC",
"track_seen": 0
}