-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44425 from frappe/mergify/bp/version-15-hotfix/pr…
…-44302 fix: Minor Updates in `Payment Request` and `Payment Entry` (backport #44302)
- Loading branch information
Showing
5 changed files
with
33 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
erpnext/accounts/doctype/payment_request/payment_request_dashboard.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from frappe import _ | ||
|
||
|
||
def get_data(): | ||
return { | ||
"fieldname": "payment_request", | ||
"internal_links": { | ||
"Payment Entry": ["references", "payment_request"], | ||
"Payment Order": ["references", "payment_order"], | ||
}, | ||
"transactions": [ | ||
{"label": _("Payment"), "items": ["Payment Entry", "Payment Order"]}, | ||
], | ||
} |
27 changes: 13 additions & 14 deletions
27
erpnext/accounts/doctype/payment_request/payment_request_list.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
const INDICATORS = { | ||
"Partially Paid": "orange", | ||
Cancelled: "red", | ||
Draft: "gray", | ||
Failed: "red", | ||
Initiated: "green", | ||
Paid: "blue", | ||
Requested: "green", | ||
}; | ||
|
||
frappe.listview_settings["Payment Request"] = { | ||
add_fields: ["status"], | ||
get_indicator: function (doc) { | ||
if (doc.status == "Draft") { | ||
return [__("Draft"), "gray", "status,=,Draft"]; | ||
} | ||
if (doc.status == "Requested") { | ||
return [__("Requested"), "green", "status,=,Requested"]; | ||
} else if (doc.status == "Initiated") { | ||
return [__("Initiated"), "green", "status,=,Initiated"]; | ||
} else if (doc.status == "Partially Paid") { | ||
return [__("Partially Paid"), "orange", "status,=,Partially Paid"]; | ||
} else if (doc.status == "Paid") { | ||
return [__("Paid"), "blue", "status,=,Paid"]; | ||
} else if (doc.status == "Cancelled") { | ||
return [__("Cancelled"), "red", "status,=,Cancelled"]; | ||
} | ||
if (!doc.status || !INDICATORS[doc.status]) return; | ||
|
||
return [__(doc.status), INDICATORS[doc.status], `status,=,${doc.status}`]; | ||
}, | ||
}; |