Fixed related to auto fetching batch nos and date valiation in salary structure (#8666)

* Fixed related to auto fetching batch nos and date valiation in salary structure

* Update get_item_details.py
This commit is contained in:
Nabin Hait 2017-05-03 18:22:24 +05:30 committed by GitHub
parent 470535ae9b
commit 3ce41d6b1f
2 changed files with 5 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class SalaryStructure(Document):
for employee in self.get('employees'):
joining_date, relieving_date = frappe.db.get_value("Employee", employee.employee,
["date_of_joining", "relieving_date"])
if employee.from_date and getdate(employee.from_date) < joining_date:
if employee.from_date and joining_date and getdate(employee.from_date) < joining_date:
frappe.throw(_("From Date {0} for Employee {1} cannot be before employee's joining Date {2}")
.format(employee.from_date, employee.employee, joining_date))

View File

@ -74,7 +74,10 @@ def get_item_details(args):
out.update(get_pricing_rule_for_item(args))
if args.get("doctype") in ("Sales Invoice", "Delivery Note") and out.stock_qty > 0:
if (args.get("doctype") == "Delivery Note" or
(args.get("doctype") == "Sales Invoice" and args.get('update_stock'))) \
and out.warehouse and out.stock_qty > 0:
if out.has_serial_no:
out.serial_no = get_serial_no(out)