constants.py added for defaults
This commit is contained in:
parent
fd141ffe08
commit
bcdf8526d0
42
asset_lite/constants.py
Normal file
42
asset_lite/constants.py
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
"""
|
||||||
|
Default Application Configurations & Constants for Asset Lite
|
||||||
|
Centralized defaults for hospital/tenant names, warehouses, print formats, and naming series.
|
||||||
|
"""
|
||||||
|
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
DEFAULT_HOSPITAL = "King Fahad Specialist Hospital - Dammam"
|
||||||
|
DEFAULT_HOSPITAL_SHORT = "King Fahad Specialist Hospital"
|
||||||
|
DEFAULT_WAREHOUSE = "Stores - KFSH-D"
|
||||||
|
DEFAULT_HOSPITAL_ABBR = "KFSH-D"
|
||||||
|
|
||||||
|
# Print Formats & Reports
|
||||||
|
DEFAULT_PRINT_FORMAT = "Service Report"
|
||||||
|
DEFAULT_KK_PRINT_FORMAT = "Service Report(KK)"
|
||||||
|
|
||||||
|
# Naming Series Defaults
|
||||||
|
DEFAULT_ASSET_NAMING_SERIES = "ASM-KFSH-.YYYY.-"
|
||||||
|
|
||||||
|
|
||||||
|
@frappe.whitelist(allow_guest=False)
|
||||||
|
def get_app_defaults():
|
||||||
|
"""Returns application default configurations for client-side consumption.
|
||||||
|
|
||||||
|
Usage in Desk Client Script / JS:
|
||||||
|
frappe.call({
|
||||||
|
method: "asset_lite.constants.get_app_defaults",
|
||||||
|
callback: function(r) {
|
||||||
|
if (r.message) {
|
||||||
|
console.log(r.message.DEFAULT_HOSPITAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
"""
|
||||||
|
return {
|
||||||
|
"DEFAULT_HOSPITAL": DEFAULT_HOSPITAL,
|
||||||
|
"DEFAULT_HOSPITAL_SHORT": DEFAULT_HOSPITAL_SHORT,
|
||||||
|
"DEFAULT_WAREHOUSE": DEFAULT_WAREHOUSE,
|
||||||
|
"DEFAULT_HOSPITAL_ABBR": DEFAULT_HOSPITAL_ABBR,
|
||||||
|
"DEFAULT_PRINT_FORMAT": DEFAULT_PRINT_FORMAT,
|
||||||
|
"DEFAULT_ASSET_NAMING_SERIES": DEFAULT_ASSET_NAMING_SERIES,
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user