-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Business Trip * docs: Business Trip * fix: compatibility with HRMS * feat: add translations for Business Trip
- Loading branch information
1 parent
6d6bdce
commit e9d28bc
Showing
24 changed files
with
1,366 additions
and
47 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
Empty file.
37 changes: 37 additions & 0 deletions
37
erpnext_germany/erpnext_germany/doctype/business_trip/business_trip.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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Copyright (c) 2024, ALYF GmbH and contributors | ||
// For license information, please see license.txt | ||
|
||
frappe.ui.form.on("Business Trip", { | ||
setup(frm) { | ||
frm.set_query("employee", erpnext.queries.employee); | ||
}, | ||
|
||
from_date: function (frm) { | ||
if (!frm.doc.to_date) { | ||
frm.set_value("to_date", frm.doc.from_date); | ||
} | ||
|
||
frm.fields_dict.to_date.datepicker.update({ | ||
minDate: frm.doc.from_date ? new Date(frm.doc.from_date) : null, | ||
}); | ||
}, | ||
|
||
to_date: function (frm) { | ||
frm.fields_dict.from_date.datepicker.update({ | ||
maxDate: frm.doc.to_date ? new Date(frm.doc.to_date) : null, | ||
}); | ||
}, | ||
}); | ||
|
||
frappe.ui.form.on("Business Trip Journey", { | ||
journeys_add(frm, cdt, cdn) { | ||
frappe.model.set_value(cdt, cdn, "date", frm.doc.from_date); | ||
}, | ||
}); | ||
|
||
frappe.ui.form.on("Business Trip Accommodation", { | ||
accommodations_add(frm, cdt, cdn) { | ||
frappe.model.set_value(cdt, cdn, "from_date", frm.doc.from_date); | ||
frappe.model.set_value(cdt, cdn, "to_date", frm.doc.to_date); | ||
}, | ||
}); |
250 changes: 250 additions & 0 deletions
250
erpnext_germany/erpnext_germany/doctype/business_trip/business_trip.json
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,250 @@ | ||
{ | ||
"actions": [], | ||
"autoname": "BT-.####", | ||
"creation": "2022-10-12 21:52:42.547420", | ||
"doctype": "DocType", | ||
"editable_grid": 1, | ||
"engine": "InnoDB", | ||
"field_order": [ | ||
"employee", | ||
"company", | ||
"currency", | ||
"title", | ||
"column_break_2", | ||
"employee_name", | ||
"status", | ||
"section_break_4", | ||
"from_date", | ||
"column_break_6", | ||
"to_date", | ||
"section_break_8", | ||
"project", | ||
"column_break_10", | ||
"customer", | ||
"section_break_12", | ||
"journeys", | ||
"section_break_14", | ||
"accommodations", | ||
"section_break_16", | ||
"region", | ||
"allowances", | ||
"total_allowance", | ||
"amended_from" | ||
], | ||
"fields": [ | ||
{ | ||
"fieldname": "employee", | ||
"fieldtype": "Link", | ||
"in_standard_filter": 1, | ||
"label": "Employee", | ||
"options": "Employee", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fetch_from": "employee.company", | ||
"fieldname": "company", | ||
"fieldtype": "Link", | ||
"label": "Company", | ||
"options": "Company" | ||
}, | ||
{ | ||
"fetch_from": "company.default_currency", | ||
"fieldname": "currency", | ||
"fieldtype": "Link", | ||
"label": "Currency", | ||
"options": "Currency" | ||
}, | ||
{ | ||
"fieldname": "title", | ||
"fieldtype": "Data", | ||
"label": "Title", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname": "column_break_2", | ||
"fieldtype": "Column Break" | ||
}, | ||
{ | ||
"fetch_from": "employee.employee_name", | ||
"fieldname": "employee_name", | ||
"fieldtype": "Data", | ||
"in_list_view": 1, | ||
"label": "Employee Name", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"allow_on_submit": 1, | ||
"depends_on": "eval:!doc.__islocal", | ||
"fieldname": "status", | ||
"fieldtype": "Select", | ||
"label": "Status", | ||
"options": "\nSubmitted\nApproved\nRejected\nPaid\nBilled" | ||
}, | ||
{ | ||
"fieldname": "section_break_4", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"fieldname": "from_date", | ||
"fieldtype": "Date", | ||
"in_list_view": 1, | ||
"label": "From Date", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname": "column_break_6", | ||
"fieldtype": "Column Break" | ||
}, | ||
{ | ||
"fieldname": "to_date", | ||
"fieldtype": "Date", | ||
"in_list_view": 1, | ||
"label": "To Date", | ||
"reqd": 1 | ||
}, | ||
{ | ||
"fieldname": "section_break_8", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"fieldname": "project", | ||
"fieldtype": "Link", | ||
"in_standard_filter": 1, | ||
"label": "Project", | ||
"options": "Project" | ||
}, | ||
{ | ||
"fieldname": "column_break_10", | ||
"fieldtype": "Column Break" | ||
}, | ||
{ | ||
"fetch_from": "project.customer", | ||
"fieldname": "customer", | ||
"fieldtype": "Link", | ||
"label": "Customer", | ||
"options": "Customer" | ||
}, | ||
{ | ||
"fieldname": "section_break_12", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"fieldname": "journeys", | ||
"fieldtype": "Table", | ||
"label": "Journeys", | ||
"options": "Business Trip Journey" | ||
}, | ||
{ | ||
"fieldname": "section_break_14", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"fieldname": "accommodations", | ||
"fieldtype": "Table", | ||
"label": "Accommodations", | ||
"options": "Business Trip Accommodation" | ||
}, | ||
{ | ||
"fieldname": "section_break_16", | ||
"fieldtype": "Section Break" | ||
}, | ||
{ | ||
"fieldname": "region", | ||
"fieldtype": "Link", | ||
"label": "Region", | ||
"options": "Business Trip Region" | ||
}, | ||
{ | ||
"fieldname": "allowances", | ||
"fieldtype": "Table", | ||
"label": "Allowances", | ||
"options": "Business Trip Allowance" | ||
}, | ||
{ | ||
"fieldname": "total_allowance", | ||
"fieldtype": "Currency", | ||
"label": "Total Allowance", | ||
"read_only": 1 | ||
}, | ||
{ | ||
"fieldname": "amended_from", | ||
"fieldtype": "Link", | ||
"label": "Amended From", | ||
"no_copy": 1, | ||
"options": "Business Trip", | ||
"print_hide": 1, | ||
"read_only": 1 | ||
} | ||
], | ||
"index_web_pages_for_search": 1, | ||
"is_submittable": 1, | ||
"links": [ | ||
{ | ||
"link_doctype": "Expense Claim", | ||
"link_fieldname": "business_trip" | ||
} | ||
], | ||
"modified": "2024-09-04 23:27:34.065131", | ||
"modified_by": "Administrator", | ||
"module": "ERPNext Germany", | ||
"name": "Business Trip", | ||
"naming_rule": "Expression (old style)", | ||
"owner": "Administrator", | ||
"permissions": [ | ||
{ | ||
"amend": 1, | ||
"cancel": 1, | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "System Manager", | ||
"share": 1, | ||
"submit": 1, | ||
"write": 1 | ||
}, | ||
{ | ||
"amend": 1, | ||
"cancel": 1, | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "Projects Manager", | ||
"share": 1, | ||
"submit": 1, | ||
"write": 1 | ||
}, | ||
{ | ||
"create": 1, | ||
"delete": 1, | ||
"email": 1, | ||
"export": 1, | ||
"if_owner": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "Employee", | ||
"share": 1, | ||
"write": 1 | ||
}, | ||
{ | ||
"email": 1, | ||
"export": 1, | ||
"print": 1, | ||
"read": 1, | ||
"report": 1, | ||
"role": "Accounts User" | ||
} | ||
], | ||
"sort_field": "modified", | ||
"sort_order": "DESC", | ||
"states": [], | ||
"title_field": "title" | ||
} |
Oops, something went wrong.