Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
"label": "Selling Price per Sqm",
"reqd": 1,
"in_list_view": 1
},
{
"fieldname": "land_rent_rate",
"fieldtype": "Float",
"label": "Land Rent Rate (TZS/sqm)",
"fetch_from": "plot_type.land_rent_rate",
"fetch_if_empty": 0,
"read_only": 1,
"in_list_view": 1
}
]
}
31 changes: 31 additions & 0 deletions landms/landms/doctype/landms_settings/landms_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,37 @@
"default": "7",
"description": "Days the paid application reserves the plot before the Sales Order must be created"
},
{
"fieldname": "govt_fees_section",
"fieldtype": "Section Break",
"label": "Government Fees (Informational)"
},
{
"fieldname": "govt_appl_fee_amount",
"fieldtype": "Float",
"label": "Govt Application Fee (TZS)",
"default": "5000",
"description": "Fixed government application fee (APPL). Not your revenue — shown on plot documents for buyer reference."
},
{
"fieldname": "govt_registration_fee_amount",
"fieldtype": "Float",
"label": "Govt Registration Fee (TZS)",
"default": "25000",
"description": "Fixed government registration fee (REGISTR). Not your revenue — shown on plot documents for buyer reference."
},
{
"fieldname": "col_break_govt_fees",
"fieldtype": "Column Break"
},
{
"fieldname": "govt_premium_rate",
"fieldtype": "Float",
"label": "Govt Premium Rate",
"precision": "4",
"default": "0.0025",
"description": "Premium rate applied to selling price (e.g. 0.0025 = 0.25%). Not your revenue."
},
{
"fieldname": "app_fee_accounts_section",
"fieldtype": "Section Break",
Expand Down
73 changes: 73 additions & 0 deletions landms/landms/doctype/plot_master/plot_master.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,79 @@
"options": "Plot Master",
"read_only": 1,
"print_hide": 1
},
{
"fieldname": "govt_fees_section",
"fieldtype": "Section Break",
"label": "Government Fees (Informational)"
},
{
"fieldname": "land_rent_rate",
"fieldtype": "Float",
"label": "Land Rent Rate (TZS/sqm)",
"read_only": 1
},
{
"fieldname": "land_rent",
"fieldtype": "Currency",
"label": "Land Rent (L/RENT)",
"read_only": 1
},
{
"fieldname": "registration_prep_fee",
"fieldtype": "Currency",
"label": "Registration Prep Fee (CT)",
"read_only": 1
},
{
"fieldname": "col_break_govt_fees",
"fieldtype": "Column Break"
},
{
"fieldname": "govt_application_fee",
"fieldtype": "Currency",
"label": "Govt Application Fee (APPL)",
"read_only": 1
},
{
"fieldname": "premium",
"fieldtype": "Currency",
"label": "Premium",
"read_only": 1
},
{
"fieldname": "govt_registration_fee",
"fieldtype": "Currency",
"label": "Govt Registration Fee (REGISTR)",
"read_only": 1
},
{
"fieldname": "stamp_duty",
"fieldtype": "Currency",
"label": "Stamp Duty",
"read_only": 1
},
{
"fieldname": "govt_totals_section",
"fieldtype": "Section Break"
},
{
"fieldname": "total_govt_fees",
"fieldtype": "Currency",
"label": "Total Government Fees",
"read_only": 1,
"bold": 1
},
{
"fieldname": "col_break_totals",
"fieldtype": "Column Break"
},
{
"fieldname": "total_plot_amount",
"fieldtype": "Currency",
"label": "Total Amount (CAPS + Govt Fees)",
"read_only": 1,
"bold": 1
}
],
"permissions": [
Expand Down
26 changes: 26 additions & 0 deletions landms/landms/doctype/plot_master/plot_master.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,32 @@ def fill_financials(self):
else:
self.selling_price = 0

self._fill_govt_fees(plot_sqm)

def _fill_govt_fees(self, plot_sqm):
land_rent_rate = flt(frappe.db.get_value("Plot Type", self.plot_type, "land_rent_rate"))
settings = frappe.get_single("LandMS Settings")
appl = flt(settings.govt_appl_fee_amount) or 5000
reg_fee = flt(settings.govt_registration_fee_amount) or 25000
prem_rate = flt(settings.govt_premium_rate) or 0.0025

self.land_rent_rate = land_rent_rate
self.land_rent = flt(land_rent_rate * plot_sqm)
self.govt_application_fee = appl
self.premium = flt(prem_rate * flt(self.selling_price))
self.registration_prep_fee = flt(0.2 * self.land_rent)
self.govt_registration_fee = reg_fee
self.stamp_duty = flt(((self.land_rent - 2000) / 20) + 500) if self.land_rent > 0 else 0
self.total_govt_fees = flt(
self.govt_application_fee +
self.premium +
self.land_rent +
self.registration_prep_fee +
self.govt_registration_fee +
self.stamp_duty
)
self.total_plot_amount = flt(self.selling_price) + self.total_govt_fees

def validate_coordinate_pair(self):
"""Either both lat/lon are set, or both are blank."""
has_lat = self.latitude not in (None, "", 0)
Expand Down
7 changes: 7 additions & 0 deletions landms/landms/doctype/plot_type/plot_type.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
"reqd": 1,
"in_list_view": 1,
"description": "ERPNext item used when this plot type enters inventory on Plot Master submit"
},
{
"fieldname": "land_rent_rate",
"fieldtype": "Float",
"label": "Land Rent Rate (TZS/sqm)",
"in_list_view": 1,
"description": "Government land rent rate per square metre for this plot type. Used to calculate land rent and related fees on the plot."
}
],
"permissions": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,22 @@
"depends_on": "eval:doc.plot",
"description": "Tick to prevent the bank from accepting payments after the payment deadline date above."
},
{
"doctype": "Custom Field",
"dt": "Sales Order",
"module": "LandMS",
"fieldname": "col_break_tcb_checks",
"fieldtype": "Column Break",
"insert_after": "include_expire_date"
},
{
"doctype": "Custom Field",
"dt": "Sales Order",
"module": "LandMS",
"fieldname": "include_related_ref",
"fieldtype": "Check",
"label": "Generate Related Reference Number",
"insert_after": "include_expire_date",
"insert_after": "col_break_tcb_checks",
"default": "0",
"depends_on": "eval:doc.plot",
"description": "Tick if a second reference number is needed for this sale."
Expand Down
Loading