Merge pull request #3743 from rmehta/indicator-fix

[fix] indicators for sales order, purchase order #3736
This commit is contained in:
Nabin Hait 2015-07-29 15:53:44 +05:30
commit d46fb5eb8c
2 changed files with 26 additions and 2 deletions

View File

@ -5,7 +5,13 @@ frappe.listview_settings['Purchase Order'] = {
if(doc.status==="Stopped") { if(doc.status==="Stopped") {
return [__("Stopped"), "darkgrey", "status,=,Stopped"]; return [__("Stopped"), "darkgrey", "status,=,Stopped"];
} else if(flt(doc.per_received) < 100 && doc.status!=="Stopped") { } else if(flt(doc.per_received) < 100 && doc.status!=="Stopped") {
return [__("Not Received"), "orange", "per_received,<,100|status,!=,Stopped"]; if(flt(doc.per_billed) < 100) {
return [__("To Receive and Bill"), "orange",
"per_received,<,100|per_billed,<,100|status,!=,Stopped"];
} else {
return [__("To Receive"), "orange",
"per_received,<,100|per_billed,=,100|status,!=,Stopped"];
}
} else if(flt(doc.per_received) == 100 && flt(doc.per_billed) < 100 && doc.status!=="Stopped") { } else if(flt(doc.per_received) == 100 && flt(doc.per_billed) < 100 && doc.status!=="Stopped") {
return [__("To Bill"), "orange", "per_received,=,100|per_billed,<,100|status,!=,Stopped"]; return [__("To Bill"), "orange", "per_received,=,100|per_billed,<,100|status,!=,Stopped"];
} else if(flt(doc.per_received) == 100 && flt(doc.per_billed) == 100 && doc.status!=="Stopped") { } else if(flt(doc.per_received) == 100 && flt(doc.per_billed) == 100 && doc.status!=="Stopped") {

View File

@ -5,12 +5,30 @@ frappe.listview_settings['Sales Order'] = {
if(doc.status==="Stopped") { if(doc.status==="Stopped") {
return [__("Stopped"), "darkgrey", "status,=,Stopped"]; return [__("Stopped"), "darkgrey", "status,=,Stopped"];
} else if(flt(doc.per_delivered) < 100 && frappe.datetime.get_diff(doc.delivery_date) < 0) { } else if(flt(doc.per_delivered) < 100 && frappe.datetime.get_diff(doc.delivery_date) < 0) {
// to bill & overdue
return [__("Overdue"), "red", "per_delivered,<,100|delivery_date,<,Today|status,!=,Stopped"]; return [__("Overdue"), "red", "per_delivered,<,100|delivery_date,<,Today|status,!=,Stopped"];
} else if(flt(doc.per_delivered) < 100 && doc.status!=="Stopped") { } else if(flt(doc.per_delivered) < 100 && doc.status!=="Stopped") {
return [__("Not Delivered"), "orange", "per_delivered,<,100|status,!=,Stopped"]; // not delivered
if(flt(doc.per_billed) < 100) {
// not delivered & not billed
return [__("To Deliver and Bill"), "orange",
"per_delivered,<,100|per_billed,<,100|status,!=,Stopped"];
} else {
// not billed
return [__("To Deliver"), "orange",
"per_delivered,<,100|per_billed,=,100|status,!=,Stopped"];
}
} else if(flt(doc.per_delivered) == 100 && flt(doc.per_billed) < 100 && doc.status!=="Stopped") { } else if(flt(doc.per_delivered) == 100 && flt(doc.per_billed) < 100 && doc.status!=="Stopped") {
// to bill
return [__("To Bill"), "orange", "per_delivered,=,100|per_billed,<,100|status,!=,Stopped"]; return [__("To Bill"), "orange", "per_delivered,=,100|per_billed,<,100|status,!=,Stopped"];
} else if(flt(doc.per_delivered) == 100 && flt(doc.per_billed) == 100 && doc.status!=="Stopped") { } else if(flt(doc.per_delivered) == 100 && flt(doc.per_billed) == 100 && doc.status!=="Stopped") {
return [__("Completed"), "green", "per_delivered,=,100|per_billed,=,100|status,!=,Stopped"]; return [__("Completed"), "green", "per_delivered,=,100|per_billed,=,100|status,!=,Stopped"];
} }
}, },