# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from . import __version__ as app_version

app_name = "angola_erp"
app_title = "Angola ERPNext"
app_publisher = "Helio de Jesus"
app_description = "Angola ERPNEXT extensao"
app_icon = "/assets/angola_erp/images/angolaerp.svg"
app_color = "grey"
app_email = "hcesar@gmail.com"
app_license = "MIT"
fixtures = ["Custom Field","Custom Script"]
agt_lic = "016AGT03062019"

error_report_email = "angolaerp@angolaerp.co.ao"

#fixtures = ["Custom Field","Custom Script","IRT","INSS","Subsidios","Retencoes","Salary Component"]

# Includes in <head>
# ------------------

# include js, css files in header of desk.html

app_include_css = "assets/angola_erp/css/angola_erp.css"

#app_include_css = [ "assets/angola_erp/css/angola_erp.css", "assets/angola_erp/css/erpnext/bootstrap.css" ]

#app_include_js = "assets/js/angola_erp.min.js"

app_include_js = ["assets/js/angola_erp.min.js", "assets/js/carregarcss.js"]

#app_include_js = [
#	"assets/js/angola_erp.min.js",
#	"assets/js/bootstrap.js",
#	"assets/js/bootstrap.min.js"
#]
#app_include_css = [
#	"assets/angola_erp/css/angola_erp.css",
#	"assets/angola_erp/css/bootstrap-theme.css",
#	"assets/angola_erp/css/bootstrap.min.css",
#	"assets/angola_erp/css/bootstrap-theme.min.css",
#	"assets/angola_erp/css/website.css"
#]



# include js, css files in header of web template
web_include_css = "assets/angola_erp/css/angola_erp.css"
web_include_js = "assets/js/angola_erp-web.min.js"

bootstrap = "assets/angola_erp/css/bootstrap.css"

website_context = {
	"favicon": 	"/assets/angola_erp/images/angolaerp.ico",
	"splash_image": "/assets/angola_erp/images/angolaerp.svg"
}

# login

on_session_creation = [
	"angola_erp.util.angola.css_per_user"
]


# Home Pages
# ----------

# application home page (will override Website Settings)
# home_page = "login"

# website user home page (by Role)
# role_home_page = {
#	"Role": "home_page"
# }

# Website user home page (by function)
# get_website_user_home_page = "angola_erp.utils.get_home_page"

# Generators
# ----------

# automatically create page for each record of this doctype
#website_generators = ["WOD"]


website_route_rules = [

	{"from_route": "/wods", "to_route": "WOD"},

]
# Installation
# ------------

# before_install = "angola_erp.install.before_install"
# after_install = "angola_erp.install.after_install"

# Desk Notifications
# ------------------
# See frappe.core.notifications.get_notification_config

notification_config = "angola_erp.notifications.get_notification_config"

# Permissions
# -----------
# Permissions evaluated in scripted ways

# permission_query_conditions = {
# 	"Event": "frappe.desk.doctype.event.event.get_permission_query_conditions",
# }
#
# has_permission = {
# 	"Event": "frappe.desk.doctype.event.event.has_permission",
# }

# Document Events
# ---------------
# Hook on document methods and events

doc_events = {
# 	"*": {
# 		"on_update": "method",
# 		"on_cancel": "method",
# 		"on_trash": "method"
#	}

	"Salary Slip":{
		"validate": "angola_erp.angola_erpnext.validations.salary_slip.validate",
	},
	"Employee": {
		"validate": "angola_erp.angola_erpnext.validations.employee.validate",

	},
	"Sales Order": {
		"validate": "angola_erp.angola_erpnext.validations.sales_order.validate",

	},
	"Sales Invoice": {
		"validate": "angola_erp.angola_erpnext.validations.sales_invoice.validate",
		"on_submit": "angola_erp.angola_erpnext.validations.sales_invoice.on_submit",
		"before_submit": "angola_erp.angola_erpnext.validations.sales_invoice.before_submit",
		"before_save": "angola_erp.angola_erpnext.validations.sales_invoice.before_save",
	},
	"Quotation": {
		"validate": "angola_erp.angola_erpnext.validations.quotation.validate",
		"before_submit": "angola_erp.angola_erpnext.validations.quotation.before_submit",

	},
	"Purchase Invoice": {
		"validate": "angola_erp.angola_erpnext.validations.purchase_invoice.validate",

	},
	"Purchase Order": {
		"validate": "angola_erp.angola_erpnext.validations.purchase_order.validate",
		"before_submit": "angola_erp.angola_erpnext.validations.purchase_order.before_submit",
	},
	"Fees": {
		"validate": "angola_erp.angola_erpnext.validations.fees.validate",

	},
	"Program Enrollment": {
		"validate": "angola_erp.angola_erpnext.validations.program_enrollment.validate",

	},
	"Payment Entry": {
		"on_submit": "angola_erp.angola_erpnext.validations.payment_entry.on_submit",

	},
	"Patient": {
		"after_insert": "angola_erp.angola_erpnext.validations.patient.after_insert",
		"validate": "angola_erp.angola_erpnext.validations.patient.validate",

	},
	"Project": {
		"validate": "angola_erp.angola_erpnext.validations.project.validate",
	},
	"Student": {
		"validate": "angola_erp.angola_erpnext.validations.student.validate",

	},
	"Delivery Note": {
		"validate": "angola_erp.angola_erpnext.validations.delivery_note.validate",
		"before_submit": "angola_erp.angola_erpnext.validations.delivery_note.before_submit",

	},
	"Leave Application": {
		"autoname": "angola_erp.angola_erpnext.validations.leave_application.autoname",
		"validate": "angola_erp.angola_erpnext.validations.leave_application.validate",
	},



#	"System Settings": {
#		"validate": "angola_erp.angola_erpnext.validations.system_settings.validate",

#	},

}

# Scheduled Tasks
# ---------------

scheduler_events = {
 	"all": [
# 		"angola_erp.tasks.all"

		"angola_erp.gestao_residencial.doctype.api.verifica_check_in",
		"angola_erp.gestao_residencial.doctype.api.verifica_hora_saida" #Saida dos Quartos

 	],
# 	"daily": [
	"hourly": [
# 		"angola_erp.tasks.daily"
		"angola_erp.util.cambios.atualizar_cambios",	#Exchange rates updates for AOA
		"angola_erp.util.angola.verifica_imposto_expirado"
# 	],
# 	"hourly": [
# 		"angola_erp.tasks.hourly"
# 	],
# 	"weekly": [
# 		"angola_erp.tasks.weekly"
# 	]
# 	"monthly": [
# 		"angola_erp.tasks.monthly"
 	]
}

# Testing
# -------

# before_tests = "angola_erp.install.before_tests"

# Overriding Whitelisted Methods
# ------------------------------
#
# override_whitelisted_methods = {
# 	"frappe.desk.doctype.event.event.get_events": "angola_erp.event.get_events"
# }

override_whitelisted_methods = {
	"erpnext.setup.doctype.sms_settings.sms_settings.send_sms": "angola_erp.angola_erpnext.validations.sms_settings.send_sms",
	"frappe.core.doctype.sms_settings.sms_settings.send_sms": "angola_erp.angola_erpnext.validations.sms_settings.send_sms",
	"frappe.email.doctype.auto_email_report.auto_email_report.send_now": "angola_erp.angola_erpnext.validations.auto_email_report.send_now",
	"frappe.email.doctype.auto_email_report.auto_email_report.send_daily": "angola_erp.angola_erpnext.validations.auto_email_report.send_daily"

}

