Add status expired to doctype quotation
This commit is contained in:
parent
f75ea952e3
commit
53b65ab8ed
@ -301,7 +301,8 @@ scheduler_events = {
|
||||
"erpnext.quality_management.doctype.quality_review.quality_review.review",
|
||||
"erpnext.support.doctype.service_level_agreement.service_level_agreement.check_agreement_status",
|
||||
"erpnext.crm.doctype.email_campaign.email_campaign.send_email_to_leads_or_contacts",
|
||||
"erpnext.crm.doctype.email_campaign.email_campaign.set_email_campaign_status"
|
||||
"erpnext.crm.doctype.email_campaign.email_campaign.set_email_campaign_status",
|
||||
"erpnext.selling.doctype.quotation.set_expired"
|
||||
],
|
||||
"daily_long": [
|
||||
"erpnext.setup.doctype.email_digest.email_digest.send",
|
||||
|
@ -185,6 +185,14 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False):
|
||||
|
||||
return doclist
|
||||
|
||||
def set_expired_status():
|
||||
quotations = frappe.get_all("Quotation")
|
||||
for quotation in quotations:
|
||||
quotation = frappe.get_doc("Quotation",quotation.name)
|
||||
if quotation.valid_till and getdate(quotation.valid_till) < getdate(nowdate()):
|
||||
frappe.db.set(quotation,'status','Expired')
|
||||
frappe.db.commit()
|
||||
|
||||
@frappe.whitelist()
|
||||
def make_sales_invoice(source_name, target_doc=None):
|
||||
return _make_sales_invoice(source_name, target_doc)
|
||||
|
@ -14,15 +14,13 @@ frappe.listview_settings['Quotation'] = {
|
||||
|
||||
get_indicator: function(doc) {
|
||||
if(doc.status==="Open") {
|
||||
if (doc.valid_till && doc.valid_till < frappe.datetime.nowdate()) {
|
||||
return [__("Expired"), "darkgrey", "valid_till,<," + frappe.datetime.nowdate()];
|
||||
} else {
|
||||
return [__("Open"), "orange", "status,=,Open"];
|
||||
}
|
||||
return [__("Open"), "orange", "status,=,Open"];
|
||||
} else if(doc.status==="Ordered") {
|
||||
return [__("Ordered"), "green", "status,=,Ordered"];
|
||||
} else if(doc.status==="Lost") {
|
||||
return [__("Lost"), "darkgrey", "status,=,Lost"];
|
||||
} else if(doc.status==="Expired") {
|
||||
return [__("Expired"), "darkgrey", "status,=,Expired"];
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user