diff --git a/rentals/public/css/secret.css b/rentals/public/css/secret.css new file mode 100644 index 0000000..c5a243a --- /dev/null +++ b/rentals/public/css/secret.css @@ -0,0 +1,3 @@ +html { + background-color: aquamarine; +} \ No newline at end of file diff --git a/rentals/rentals/doctype/rental_settings/__init__.py b/rentals/rentals/doctype/rental_settings/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/rentals/rentals/doctype/rental_settings/rental_settings.js b/rentals/rentals/doctype/rental_settings/rental_settings.js new file mode 100644 index 0000000..46328f6 --- /dev/null +++ b/rentals/rentals/doctype/rental_settings/rental_settings.js @@ -0,0 +1,8 @@ +// Copyright (c) 2024, Victor and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Rental Settings", { +// refresh(frm) { + +// }, +// }); diff --git a/rentals/rentals/doctype/rental_settings/rental_settings.json b/rentals/rentals/doctype/rental_settings/rental_settings.json new file mode 100644 index 0000000..7387db9 --- /dev/null +++ b/rentals/rentals/doctype/rental_settings/rental_settings.json @@ -0,0 +1,40 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2024-06-13 15:23:50.144295", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "standard_rate" + ], + "fields": [ + { + "fieldname": "standard_rate", + "fieldtype": "Float", + "label": "Standard Rate" + } + ], + "index_web_pages_for_search": 1, + "issingle": 1, + "links": [], + "modified": "2024-06-13 15:24:18.051203", + "modified_by": "Administrator", + "module": "Rentals", + "name": "Rental Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "print": 1, + "read": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/rentals/rentals/doctype/rental_settings/rental_settings.py b/rentals/rentals/doctype/rental_settings/rental_settings.py new file mode 100644 index 0000000..6efe2bf --- /dev/null +++ b/rentals/rentals/doctype/rental_settings/rental_settings.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Victor and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class RentalSettings(Document): + pass diff --git a/rentals/rentals/doctype/rental_settings/test_rental_settings.py b/rentals/rentals/doctype/rental_settings/test_rental_settings.py new file mode 100644 index 0000000..500ea08 --- /dev/null +++ b/rentals/rentals/doctype/rental_settings/test_rental_settings.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Victor and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestRentalSettings(FrappeTestCase): + pass diff --git a/rentals/rentals/doctype/ride_booking/ride_booking.py b/rentals/rentals/doctype/ride_booking/ride_booking.py index 52dc89b..c4e9d7b 100644 --- a/rentals/rentals/doctype/ride_booking/ride_booking.py +++ b/rentals/rentals/doctype/ride_booking/ride_booking.py @@ -8,7 +8,7 @@ class RideBooking(Document): def validate(self): if not self.rate: - frappe.throw("Please provide rate") + self.rate = frappe.db.get_single_value("Rental Settings", "standard_rate") total_distance = 0 for item in self.items: diff --git a/rentals/rentals/doctype/vehicle/vehicle.json b/rentals/rentals/doctype/vehicle/vehicle.json index 40e98c3..17eb1c2 100644 --- a/rentals/rentals/doctype/vehicle/vehicle.json +++ b/rentals/rentals/doctype/vehicle/vehicle.json @@ -14,7 +14,9 @@ "color", "insurance_expiry", "column_break_vtzo", + "audit_completed", "is_published", + "type", "vehicle_image", "route", "status", @@ -95,13 +97,26 @@ "fieldname": "condition", "fieldtype": "Rating", "label": "Condition" + }, + { + "default": "0", + "fieldname": "audit_completed", + "fieldtype": "Check", + "label": "Audit Completed?", + "permlevel": 1 + }, + { + "fieldname": "type", + "fieldtype": "Link", + "label": "Type", + "options": "Vehicle Type" } ], "has_web_view": 1, "index_web_pages_for_search": 1, "is_published_field": "is_published", "links": [], - "modified": "2024-06-10 17:27:31.099690", + "modified": "2024-06-14 18:24:47.764566", "modified_by": "Administrator", "module": "Rentals", "name": "Vehicle", @@ -118,6 +133,34 @@ "role": "System Manager", "share": 1, "write": 1 + }, + { + "create": 1, + "export": 1, + "read": 1, + "report": 1, + "role": "Vehicle Manager", + "write": 1 + }, + { + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Vehicle Auditor", + "share": 1 + }, + { + "email": 1, + "export": 1, + "permlevel": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Vehicle Auditor", + "share": 1, + "write": 1 } ], "route": "cars", diff --git a/rentals/rentals/doctype/vehicle_type/__init__.py b/rentals/rentals/doctype/vehicle_type/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/rentals/rentals/doctype/vehicle_type/test_vehicle_type.py b/rentals/rentals/doctype/vehicle_type/test_vehicle_type.py new file mode 100644 index 0000000..874a9ed --- /dev/null +++ b/rentals/rentals/doctype/vehicle_type/test_vehicle_type.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Victor and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestVehicleType(FrappeTestCase): + pass diff --git a/rentals/rentals/doctype/vehicle_type/vehicle_type.js b/rentals/rentals/doctype/vehicle_type/vehicle_type.js new file mode 100644 index 0000000..3d7a524 --- /dev/null +++ b/rentals/rentals/doctype/vehicle_type/vehicle_type.js @@ -0,0 +1,8 @@ +// Copyright (c) 2024, Victor and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Vehicle Type", { +// refresh(frm) { + +// }, +// }); diff --git a/rentals/rentals/doctype/vehicle_type/vehicle_type.json b/rentals/rentals/doctype/vehicle_type/vehicle_type.json new file mode 100644 index 0000000..2e64862 --- /dev/null +++ b/rentals/rentals/doctype/vehicle_type/vehicle_type.json @@ -0,0 +1,43 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "prompt", + "creation": "2024-06-14 18:23:01.072323", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "description" + ], + "fields": [ + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2024-06-14 18:23:58.806394", + "modified_by": "Administrator", + "module": "Rentals", + "name": "Vehicle Type", + "naming_rule": "Set by user", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/rentals/rentals/doctype/vehicle_type/vehicle_type.py b/rentals/rentals/doctype/vehicle_type/vehicle_type.py new file mode 100644 index 0000000..42c5331 --- /dev/null +++ b/rentals/rentals/doctype/vehicle_type/vehicle_type.py @@ -0,0 +1,9 @@ +# Copyright (c) 2024, Victor and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class VehicleType(Document): + pass diff --git a/rentals/rentals/workspace/rentals/rentals.json b/rentals/rentals/workspace/rentals/rentals.json deleted file mode 100644 index 73b0e3b..0000000 --- a/rentals/rentals/workspace/rentals/rentals.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "charts": [], - "content": "[{\"id\":\"RYGQkVN1Qw\",\"type\":\"header\",\"data\":{\"text\":\"Rentals\",\"col\":12}},{\"id\":\"8DqK0GCWSa\",\"type\":\"number_card\",\"data\":{\"number_card_name\":\"Number of Vehicles\",\"col\":4}}]", - "creation": "2024-06-10 11:15:12.247656", - "custom_blocks": [], - "docstatus": 0, - "doctype": "Workspace", - "for_user": "", - "hide_custom": 0, - "icon": "color-review-points", - "idx": 0, - "indicator_color": "", - "is_hidden": 0, - "label": "Rentals", - "links": [], - "modified": "2024-06-11 19:40:30.675584", - "modified_by": "Administrator", - "module": "Rentals", - "name": "Rentals", - "number_cards": [ - { - "label": "Number of Vehicles", - "number_card_name": "Number of Vehicles" - } - ], - "owner": "Administrator", - "parent_page": "", - "public": 1, - "quick_lists": [], - "roles": [], - "sequence_id": 1.0, - "shortcuts": [], - "title": "Rentals" -} \ No newline at end of file diff --git a/rentals/www/hello.html b/rentals/www/hello.html index ba3c79e..5c69120 100644 --- a/rentals/www/hello.html +++ b/rentals/www/hello.html @@ -1,4 +1,5 @@ {% extends "templates/web.html" %} {% block content %}

Hello Victor {{ my_emoji }}

+ {% endblock %} \ No newline at end of file