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,
|
||||||
|
}
|
||||||
@ -5584,7 +5584,7 @@
|
|||||||
"value": "\nDaily\nWeekly\n15 Days\nMonthly\nQuarterly\n4 Months\nHalf-yearly\nYearly\n2 Yearly\n3 Yearly"
|
"value": "\nDaily\nWeekly\n15 Days\nMonthly\nQuarterly\n4 Months\nHalf-yearly\nYearly\n2 Yearly\n3 Yearly"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default_value": "ASM-KFSH-.YYYY.-",
|
"default_value": "ASM-HOSP-.YYYY.-",
|
||||||
"doc_type": "Asset",
|
"doc_type": "Asset",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"doctype": "Property Setter",
|
"doctype": "Property Setter",
|
||||||
@ -5597,6 +5597,6 @@
|
|||||||
"property": "options",
|
"property": "options",
|
||||||
"property_type": "Text",
|
"property_type": "Text",
|
||||||
"row_name": null,
|
"row_name": null,
|
||||||
"value": "ASM-KFSH-.YYYY.-\nACC-ASS-.YYYY.-"
|
"value": "ASM-HOSP-.YYYY.-"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Loading…
x
Reference in New Issue
Block a user