Skip to content

Commit

Permalink
Day 3 activities
Browse files Browse the repository at this point in the history
  • Loading branch information
victorarocha committed Jun 15, 2024
1 parent ff3a8f1 commit 2ddb182
Show file tree
Hide file tree
Showing 15 changed files with 184 additions and 36 deletions.
3 changes: 3 additions & 0 deletions rentals/public/css/secret.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
html {
background-color: aquamarine;
}
Empty file.
8 changes: 8 additions & 0 deletions rentals/rentals/doctype/rental_settings/rental_settings.js
Original file line number Diff line number Diff line change
@@ -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) {

// },
// });
40 changes: 40 additions & 0 deletions rentals/rentals/doctype/rental_settings/rental_settings.json
Original file line number Diff line number Diff line change
@@ -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": []
}
9 changes: 9 additions & 0 deletions rentals/rentals/doctype/rental_settings/rental_settings.py
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion rentals/rentals/doctype/ride_booking/ride_booking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
45 changes: 44 additions & 1 deletion rentals/rentals/doctype/vehicle/vehicle.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
"color",
"insurance_expiry",
"column_break_vtzo",
"audit_completed",
"is_published",
"type",
"vehicle_image",
"route",
"status",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down
Empty file.
9 changes: 9 additions & 0 deletions rentals/rentals/doctype/vehicle_type/test_vehicle_type.py
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions rentals/rentals/doctype/vehicle_type/vehicle_type.js
Original file line number Diff line number Diff line change
@@ -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) {

// },
// });
43 changes: 43 additions & 0 deletions rentals/rentals/doctype/vehicle_type/vehicle_type.json
Original file line number Diff line number Diff line change
@@ -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": []
}
9 changes: 9 additions & 0 deletions rentals/rentals/doctype/vehicle_type/vehicle_type.py
Original file line number Diff line number Diff line change
@@ -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
34 changes: 0 additions & 34 deletions rentals/rentals/workspace/rentals/rentals.json

This file was deleted.

1 change: 1 addition & 0 deletions rentals/www/hello.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% extends "templates/web.html" %}
{% block content %}
<h2>Hello Victor {{ my_emoji }}</h2>

{% endblock %}

0 comments on commit 2ddb182

Please sign in to comment.