How to get data for a field from another doctype?

Hello!
I have 2 doctypes Reservation and Base pricing with fields Reservation{Resource, Adult_count, Price_charged} and Base Pricing{Adult_count, Per_person_rate, Resource}
while making the reservation it should fetch the data from Base pricing and should give the total cost of Price_charged based on Adult_count and resource type and it should be different for weekends and weekdays with some calculations.
how can I edit the custom script, Can anyone help me out for solving this?

Thanks!

1 Like

Hi, I am non technical and would want to know how to apply weekday wise price for say a territory>Product>Weekday and the same can be applied in subscription for calendar month so that when Quotation/Order/Invoice is created it should fetch weekday rate for the calendar month. I wish to achieve the above through doctype so that version upgrades are a breeze.

Create Doctype for storing the price with the weekdays for eg. (Day = Monday , Price = 1000)

get the value from the doctype based on the current day

price = frappe.db.get_value(Your_doctype, {‘day’:current_day}, ‘price’)