Merge branch 'staging' into develop
This commit is contained in:
commit
ea42980de6
@ -5,7 +5,7 @@ import frappe
|
|||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
from frappe.utils import getdate
|
from frappe.utils import getdate
|
||||||
|
|
||||||
__version__ = '10.1.67'
|
__version__ = '10.1.68'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||||
# License: GNU General Public License v3. See license.txt
|
# License: GNU General Public License v3. See license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
from past.builtins import cmp
|
from past.builtins import cmp
|
||||||
@ -342,7 +344,7 @@ def set_gl_entries_by_account(
|
|||||||
accounts = frappe.db.sql_list("""select name from `tabAccount`
|
accounts = frappe.db.sql_list("""select name from `tabAccount`
|
||||||
where lft >= %s and rgt <= %s""", (root_lft, root_rgt))
|
where lft >= %s and rgt <= %s""", (root_lft, root_rgt))
|
||||||
additional_conditions += " and account in ({})"\
|
additional_conditions += " and account in ({})"\
|
||||||
.format(", ".join([frappe.safe_encode(frappe.db.escape(d)) for d in accounts]))
|
.format(", ".join([frappe.db.escape(d) for d in accounts]))
|
||||||
|
|
||||||
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry`
|
gl_entries = frappe.db.sql("""select posting_date, account, debit, credit, is_opening, fiscal_year, debit_in_account_currency, credit_in_account_currency, account_currency from `tabGL Entry`
|
||||||
where company=%(company)s
|
where company=%(company)s
|
||||||
@ -400,7 +402,6 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters):
|
|||||||
|
|
||||||
def get_cost_centers_with_children(cost_centers):
|
def get_cost_centers_with_children(cost_centers):
|
||||||
if not isinstance(cost_centers, list):
|
if not isinstance(cost_centers, list):
|
||||||
cost_centers = frappe.safe_encode(cost_centers)
|
|
||||||
cost_centers = [d.strip() for d in cost_centers.strip().split(',') if d]
|
cost_centers = [d.strip() for d in cost_centers.strip().split(',') if d]
|
||||||
|
|
||||||
all_cost_centers = []
|
all_cost_centers = []
|
||||||
|
|||||||
@ -85,8 +85,17 @@ class Asset(AccountsController):
|
|||||||
elif not self.finance_books:
|
elif not self.finance_books:
|
||||||
frappe.throw(_("Enter depreciation details"))
|
frappe.throw(_("Enter depreciation details"))
|
||||||
|
|
||||||
if self.available_for_use_date and getdate(self.available_for_use_date) < getdate(nowdate()):
|
if self.is_existing_asset:
|
||||||
frappe.throw(_("Available-for-use Date is entered as past date"))
|
return
|
||||||
|
|
||||||
|
date = nowdate()
|
||||||
|
docname = self.purchase_receipt or self.purchase_invoice
|
||||||
|
if docname:
|
||||||
|
doctype = 'Purchase Receipt' if self.purchase_receipt else 'Purchase Invoice'
|
||||||
|
date = frappe.db.get_value(doctype, docname, 'posting_date')
|
||||||
|
|
||||||
|
if self.available_for_use_date and getdate(self.available_for_use_date) < getdate(date):
|
||||||
|
frappe.throw(_("Available-for-use Date should be after purchase date"))
|
||||||
|
|
||||||
def make_depreciation_schedule(self):
|
def make_depreciation_schedule(self):
|
||||||
if self.depreciation_method != 'Manual':
|
if self.depreciation_method != 'Manual':
|
||||||
|
|||||||
@ -12,7 +12,7 @@ app_license = "GNU General Public License (v3)"
|
|||||||
source_link = "https://github.com/frappe/erpnext"
|
source_link = "https://github.com/frappe/erpnext"
|
||||||
|
|
||||||
develop_version = '12.x.x-develop'
|
develop_version = '12.x.x-develop'
|
||||||
staging_version = '11.0.3-beta.18'
|
staging_version = '11.0.3-beta.19'
|
||||||
|
|
||||||
error_report_email = "support@erpnext.com"
|
error_report_email = "support@erpnext.com"
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe import _
|
from frappe import _
|
||||||
from frappe.utils.nestedset import rebuild_tree
|
from frappe.utils.nestedset import rebuild_tree
|
||||||
|
|||||||
@ -85,9 +85,9 @@ class SerialNo(StockController):
|
|||||||
self.purchase_date = purchase_sle.posting_date
|
self.purchase_date = purchase_sle.posting_date
|
||||||
self.purchase_time = purchase_sle.posting_time
|
self.purchase_time = purchase_sle.posting_time
|
||||||
self.purchase_rate = purchase_sle.incoming_rate
|
self.purchase_rate = purchase_sle.incoming_rate
|
||||||
if purchase_sle.voucher_type == "Purchase Receipt":
|
if purchase_sle.voucher_type in ("Purchase Receipt", "Purchase Invoice"):
|
||||||
self.supplier, self.supplier_name = \
|
self.supplier, self.supplier_name = \
|
||||||
frappe.db.get_value("Purchase Receipt", purchase_sle.voucher_no,
|
frappe.db.get_value(purchase_sle.voucher_type, purchase_sle.voucher_no,
|
||||||
["supplier", "supplier_name"])
|
["supplier", "supplier_name"])
|
||||||
|
|
||||||
# If sales return entry
|
# If sales return entry
|
||||||
@ -304,8 +304,8 @@ def has_duplicate_serial_no(sn, sle):
|
|||||||
|
|
||||||
status = False
|
status = False
|
||||||
if sn.purchase_document_no:
|
if sn.purchase_document_no:
|
||||||
if sle.voucher_type in ['Purchase Receipt', 'Stock Entry'] and \
|
if sle.voucher_type in ['Purchase Receipt', 'Stock Entry', "Purchase Invoice"] and \
|
||||||
sn.delivery_document_type not in ['Purchase Receipt', 'Stock Entry']:
|
sn.delivery_document_type not in ['Purchase Receipt', 'Stock Entry', "Purchase Invoice"]:
|
||||||
status = True
|
status = True
|
||||||
|
|
||||||
if status and sle.voucher_type == 'Stock Entry' and \
|
if status and sle.voucher_type == 'Stock Entry' and \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user