Merge pull request #2125 from anandpdoshi/anand-august-29
[fix] Maintenance Schedule, Incoming Rate
This commit is contained in:
commit
d490933fce
@ -67,7 +67,7 @@ def get_incoming_rate(args):
|
|||||||
from erpnext.stock.stock_ledger import get_previous_sle
|
from erpnext.stock.stock_ledger import get_previous_sle
|
||||||
|
|
||||||
in_rate = 0
|
in_rate = 0
|
||||||
if args.get("serial_no"):
|
if (args.get("serial_no") or "").strip():
|
||||||
in_rate = get_avg_purchase_rate(args.get("serial_no"))
|
in_rate = get_avg_purchase_rate(args.get("serial_no"))
|
||||||
else:
|
else:
|
||||||
valuation_method = get_valuation_method(args.get("item_code"))
|
valuation_method = get_valuation_method(args.get("item_code"))
|
||||||
|
|||||||
@ -134,7 +134,7 @@ class MaintenanceSchedule(TransactionBase):
|
|||||||
|
|
||||||
def validate_dates_with_periodicity(self):
|
def validate_dates_with_periodicity(self):
|
||||||
for d in self.get("item_maintenance_detail"):
|
for d in self.get("item_maintenance_detail"):
|
||||||
if d.start_date and d.end_date and d.periodicity:
|
if d.start_date and d.end_date and d.periodicity and d.periodicity!="Random":
|
||||||
date_diff = (getdate(d.end_date) - getdate(d.start_date)).days + 1
|
date_diff = (getdate(d.end_date) - getdate(d.start_date)).days + 1
|
||||||
days_in_period = {
|
days_in_period = {
|
||||||
"Weekly": 7,
|
"Weekly": 7,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user