Merge branch 'develop'
This commit is contained in:
commit
943dc1f59c
@ -1,2 +1,2 @@
|
||||
from __future__ import unicode_literals
|
||||
__version__ = '5.0.27'
|
||||
__version__ = '5.0.28'
|
||||
|
1
erpnext/change_log/v5/v5_0_28.md
Normal file
1
erpnext/change_log/v5/v5_0_28.md
Normal file
@ -0,0 +1 @@
|
||||
- Open notification of Sales Order and Purchase Order based on whether Invoice is created against them. For eg. If a Sales Order is not Invoiced, it will be considered as open. Previously it was considered open if Delivery Note was created against Sales Order.
|
@ -5,7 +5,7 @@ app_publisher = "Frappe Technologies Pvt. Ltd. and Contributors"
|
||||
app_description = "Open Source Enterprise Resource Planning for Small and Midsized Organizations"
|
||||
app_icon = "icon-th"
|
||||
app_color = "#e74c3c"
|
||||
app_version = "5.0.27"
|
||||
app_version = "5.0.28"
|
||||
|
||||
error_report_email = "support@erpnext.com"
|
||||
|
||||
|
@ -14,7 +14,7 @@ def get_notification_config():
|
||||
"Contact": {"status": "Open"},
|
||||
"Opportunity": {"status": "Open"},
|
||||
"Quotation": {"docstatus": 0},
|
||||
"Sales Order": { "per_delivered": ("<", 100), "status": ("!=", "Stopped"), "docstatus": ("<", 2) },
|
||||
"Sales Order": { "per_billed": ("<", 100), "status": ("!=", "Stopped"), "docstatus": ("<", 2) },
|
||||
"Journal Entry": {"docstatus": 0},
|
||||
"Sales Invoice": { "outstanding_amount": (">", 0), "docstatus": ("<", 2) },
|
||||
"Purchase Invoice": {"docstatus": 0},
|
||||
@ -25,7 +25,7 @@ def get_notification_config():
|
||||
"Delivery Note": {"docstatus": 0},
|
||||
"Stock Entry": {"docstatus": 0},
|
||||
"Material Request": {"docstatus": 0},
|
||||
"Purchase Order": { "per_received": ("<", 100), "status": ("!=", "Stopped"), "docstatus": ("<", 2) },
|
||||
"Purchase Order": { "per_billed": ("<", 100), "status": ("!=", "Stopped"), "docstatus": ("<", 2) },
|
||||
"Production Order": { "status": "In Process" },
|
||||
"BOM": {"docstatus": 0},
|
||||
"Timesheet": {"docstatus": 0},
|
||||
|
@ -5,7 +5,7 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe.defaults
|
||||
|
||||
from frappe.utils import cstr, cint, flt, comma_or, get_datetime
|
||||
from frappe.utils import cstr, cint, flt, comma_or, get_datetime, getdate
|
||||
|
||||
from frappe import _
|
||||
from erpnext.stock.utils import get_incoming_rate
|
||||
@ -66,6 +66,7 @@ class StockEntry(StockController):
|
||||
self.validate_valuation_rate()
|
||||
self.set_total_incoming_outgoing_value()
|
||||
self.set_total_amount()
|
||||
self.validate_batch()
|
||||
|
||||
def on_submit(self):
|
||||
self.update_stock_ledger()
|
||||
@ -359,8 +360,11 @@ class StockEntry(StockController):
|
||||
if self.purpose == "Subcontract" and self.purchase_order:
|
||||
purchase_order = frappe.get_doc("Purchase Order", self.purchase_order)
|
||||
for se_item in self.items:
|
||||
total_allowed = [d.required_qty for d in purchase_order.supplied_items \
|
||||
if d.rm_item_code == se_item.item_code][0]
|
||||
total_allowed = sum([flt(d.required_qty) for d in purchase_order.supplied_items \
|
||||
if d.rm_item_code == se_item.item_code])
|
||||
if not total_allowed:
|
||||
frappe.throw(_("Item {0} not found in 'Raw Materials Supplied' table in Purchase Order {1}")
|
||||
.format(se_item.item_code, self.purchase_order))
|
||||
total_supplied = frappe.db.sql("""select sum(qty)
|
||||
from `tabStock Entry Detail`, `tabStock Entry`
|
||||
where `tabStock Entry`.purchase_order = %s
|
||||
@ -722,6 +726,13 @@ class StockEntry(StockController):
|
||||
frappe.throw(_("Item or Warehouse for row {0} does not match Material Request").format(item.idx),
|
||||
frappe.MappingMismatchError)
|
||||
|
||||
def validate_batch(self):
|
||||
if self.purpose == "Material Transfer for Manufacture":
|
||||
for item in self.get("items"):
|
||||
if item.batch_no:
|
||||
if getdate(self.posting_date) > getdate(frappe.db.get_value("Batch", item.batch_no, "expiry_date")):
|
||||
frappe.throw(_("Batch {0} of Item {1} has expired.").format(item.batch_no, item.item_code))
|
||||
|
||||
@frappe.whitelist()
|
||||
def get_party_details(ref_dt, ref_dn):
|
||||
if ref_dt in ["Delivery Note", "Sales Invoice"]:
|
||||
|
Loading…
Reference in New Issue
Block a user