2015-12-15 11:50:39 +00:00
|
|
|
# Abbruchrechte einschränken
|
|
|
|
<span class="text-muted contributed-by">Beigetragen von CWT Connector & Wire Technology GmbH</span>
|
2015-12-14 15:29:18 +00:00
|
|
|
|
|
|
|
Fügen Sie dem Ereignis custom_before_cancel eine Steuerungsfunktion hinzu:
|
|
|
|
|
|
|
|
cur_frm.cscript.custom_before_cancel = function(doc) {
|
2017-06-09 11:53:06 +00:00
|
|
|
if (frappe.user_roles.indexOf("Accounts User")!=-1 && frappe.user_roles.indexOf("Accounts Manager")==-1
|
2015-12-14 15:29:18 +00:00
|
|
|
&& user_roles.indexOf("System Manager")==-1) {
|
|
|
|
if (flt(doc.grand_total) > 10000) {
|
2017-06-09 11:53:06 +00:00
|
|
|
frappe.msgprint("You can not cancel this transaction, because grand total \
|
2015-12-14 15:29:18 +00:00
|
|
|
is greater than 10000");
|
2017-06-09 11:53:06 +00:00
|
|
|
frappe.validated = false;
|
2015-12-14 15:29:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{next}
|