Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a0f2c85
fix: resolve lease status before the active-lease limit check
av-dev2 Aug 27, 2026
38ff88b
fix: store the real parent DocType on invoice schedule rows
av-dev2 Aug 27, 2026
46b08de
fix: guard the final invoice flush and surface batch failures
av-dev2 Aug 27, 2026
9d630de
fix: run the lease query through the query builder
av-dev2 Aug 27, 2026
f1c20db
fix: skip the label row when computing withholding tax
av-dev2 Aug 27, 2026
5e9487e
fix: repair the Service Type filter syntax
av-dev2 Aug 27, 2026
3831534
fix: read item_name from Sales Invoice Item
av-dev2 Aug 27, 2026
81681d9
fix: give Daily Checklist a usable naming series
av-dev2 Aug 27, 2026
22b4c48
fix: give Outsourcing Attendance a usable naming series
av-dev2 Aug 27, 2026
ffef2da
fix: give Security Attendance a usable naming series
av-dev2 Aug 27, 2026
f8284be
fix: name the tree dialog field after the Property autoname field
av-dev2 Aug 27, 2026
552f6eb
fix: format the stock shortage message with placeholders
av-dev2 Aug 27, 2026
21a442c
fix: parameterise the Rent Invoices Details queries
av-dev2 Aug 27, 2026
e42f8e6
fix: parameterise the Rent Invoices Details USD queries
av-dev2 Aug 27, 2026
84855e4
fix: parameterise the Invoice Details rate lookup
av-dev2 Aug 27, 2026
e71f45e
fix: parameterise the Utility Invoices rate lookup
av-dev2 Aug 27, 2026
a6752c1
test: register the propms before_tests bootstrap
av-dev2 Aug 27, 2026
8bf3856
test: remove the QUnit client scaffolds Frappe no longer runs
av-dev2 Aug 27, 2026
d6829ae
test: replace the dead v15 test flag with v16 test helpers
av-dev2 Aug 27, 2026
46860be
test: add the shared propms test bootstrap and factories
av-dev2 Aug 27, 2026
0fab6ad
test: cover hooks.py wiring against the installed site
av-dev2 Aug 27, 2026
95142ab
test: guard the version-16 breaking changes
av-dev2 Aug 27, 2026
58a6607
test: cover the Lease status engine and renewal
av-dev2 Aug 27, 2026
bbfe1f2
test: cover Property nesting, status and the tree view
av-dev2 Aug 27, 2026
68cc1d8
test: cover the property increment engine
av-dev2 Aug 27, 2026
bb5e962
test: cover lease invoice schedule generation
av-dev2 Aug 27, 2026
8bb5f7f
test: cover lease invoice creation and the daily batch
av-dev2 Aug 27, 2026
a0a6c79
test: cover the maintenance job card billing hook
av-dev2 Aug 27, 2026
2ff659e
test: cover auto_custom helpers and status schedulers
av-dev2 Aug 27, 2026
2996960
test: cover the point of sale lease lookup
av-dev2 Aug 27, 2026
35e649f
test: cover the install and migrate field builders
av-dev2 Aug 27, 2026
da39ac5
test: cover every shipped report
av-dev2 Aug 27, 2026
3ebde58
test: check every DocType JSON against the site
av-dev2 Aug 27, 2026
58fdb6c
test: smoke every DocType controller and list view
av-dev2 Aug 27, 2026
f23a3d8
build: add the vitest harness for the desk client scripts
av-dev2 Aug 27, 2026
26c15f6
chore: ignore the node and coverage output of the JS harness
av-dev2 Aug 27, 2026
5de6398
test: mock the desk globals the client scripts expect
av-dev2 Aug 27, 2026
662d1d7
test: check every client script for the v16 removals
av-dev2 Aug 27, 2026
5b23374
test: cover the Lease form script
av-dev2 Aug 27, 2026
0cc4439
test: cover the point of sale cost centre patch
av-dev2 Aug 27, 2026
c3ae347
test: cover the Company, Sales Invoice and tree scripts
av-dev2 Aug 27, 2026
8fc69fe
test: add the REST end-to-end suite
av-dev2 Aug 27, 2026
c3dbf4e
test: add the desk browser sweep
av-dev2 Aug 27, 2026
22e2e44
Merge remote-tracking branch 'upstream/version-16-hotfix' into pr78-fix
av-dev2 Sep 3, 2026
7130573
Merge branch 'version-16-hotfix' into test/propms-v16-suite
av-dev2 Sep 3, 2026
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
3,090 changes: 3,090 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "propms",
"private": true,
"version": "16.0.0",
"description": "Property Management Solution client-side test harness",
"scripts": {
"test": "vitest run",
"test:watch": "vitest"
},
"devDependencies": {
"@vitest/coverage-v8": "^2.1.9",
"jsdom": "^25.0.1",
"vitest": "^2.1.9"
}
}
2 changes: 1 addition & 1 deletion propms/auto_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def makeInvoiceSchedule(
doctype="Lease Invoice Schedule",
parent=name,
parentfield="lease_invoice_schedule",
parenttype="lease",
parenttype="Lease",
date_to_invoice=date_to_invoice,
schedule_start_date=date,
lease_item=item,
Expand Down
2 changes: 1 addition & 1 deletion propms/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
# Testing
# -------

# before_tests = "propms.install.before_tests"
before_tests = "propms.tests.utils.before_tests"

# Overriding Whitelisted Methods
# ------------------------------
Expand Down
6 changes: 5 additions & 1 deletion propms/lease_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def makeInvoice(
doc.submit()

return doc
except frappe.ValidationError:
raise
except Exception as e:
app_error_log(frappe.session.user, str(e))

Expand Down Expand Up @@ -147,7 +149,6 @@ def leaseInvoiceAutoCreate():
"invoice_number",
"sales_order_number",
"parent",
"parent",
"invoice_item_group",
"lease_item",
"paid_by",
Expand Down Expand Up @@ -260,6 +261,8 @@ def leaseInvoiceAutoCreate():
prev_currency = invoice_item.currency
row_num += 1 # increment by 1
# Create the last invoice
if not invoice_item:
return
res = makeInvoice(
invoice_item.date_to_invoice,
invoice_item.paid_by,
Expand All @@ -285,6 +288,7 @@ def leaseInvoiceAutoCreate():
frappe.msgprint(_("Lease Invoice generated with number: {0}").format(res.name))

except Exception as e:
frappe.log_error(frappe.get_traceback(), "Lease Invoice Auto Create failed")
app_error_log(frappe.session.user, str(e))


Expand Down
6 changes: 3 additions & 3 deletions propms/lease_invoice_schedule.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def make_lease_invoice_schedule():
# Only check start_date, ignore end_date for inclusion
)
)
lease_names = [row[0] for row in frappe.db.sql(query.get_sql())]
lease_names = [row[0] for row in query.run()]

for lease_name in lease_names:
try:
Expand Down Expand Up @@ -145,8 +145,8 @@ def make_lease_invoice_schedule():
# Move to first day of next period
invoice_date = add_days(invoice_period_end, 1)

frappe.msgprint(_(f"Completed invoice schedule for Lease: {lease.name}"))
frappe.msgprint(_("Completed invoice schedule for Lease: {0}").format(lease.name))

except Exception as e:
frappe.msgprint(_(f"Error in {lease_name}. Check app error log."))
frappe.msgprint(_("Error in {0}. Check app error log.").format(lease_name))
app_error_log(frappe.session.user, f"{lease_name}: {str(e)}")

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,16 @@
"collapsible": 0,
"columns": 0,
"fieldname": "naming_series",
"fieldtype": "Data",
"fieldtype": "Select",
"hidden": 0,
"ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0,
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
"label": "naming_series",
"label": "Naming Series",
"options": "DC-.YYYY.-",
"length": 0,
"no_copy": 0,
"permlevel": 0,
Expand All @@ -239,9 +240,9 @@
"read_only": 0,
"remember_last_selected_value": 0,
"report_hide": 0,
"reqd": 0,
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
"set_only_once": 1,
"translatable": 0,
"unique": 0
}
Expand All @@ -257,7 +258,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2018-12-24 19:42:26.306039",
"modified": "2026-08-27 12:00:00.000000",
"modified_by": "Administrator",
"module": "Property Management Solution",
"name": "Daily Checklist",
Expand Down

This file was deleted.

23 changes: 0 additions & 23 deletions propms/property_management_solution/doctype/exit/test_exit.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

26 changes: 24 additions & 2 deletions propms/property_management_solution/doctype/lease/lease.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ def on_submit(self):
app_error_log(frappe.session.user, str(e))

def validate(self):
self.set_lease_status()
self.validate_days_to_invoice_in_advance()
try:
properties = self.get_all_properties()
Expand Down Expand Up @@ -119,7 +120,28 @@ def validate(self):
raise
except Exception as e:
app_error_log(frappe.session.user, str(e))
self.set_lease_status()

def validate_days_to_invoice_in_advance(self):
"""Prevent changing 'Days to Invoice in Advance' once invoices have been generated."""
if not self.is_new() and self.has_value_changed("days_to_invoice_in_advance"):
has_generated_invoices = any(
row.invoice_number or row.sales_order_number for row in (self.lease_invoice_schedule or [])
)
if not has_generated_invoices:
has_generated_invoices = frappe.db.exists(
"Lease Invoice Schedule",
{
"parent": self.name,
"invoice_number": ["is", "set"],
},
)
if has_generated_invoices:
frappe.throw(
_(
"Cannot change 'Days to Invoice in Advance' after invoices have been generated for this Lease."
),
title=_("Field Read Only"),
)

def validate_days_to_invoice_in_advance(self):
"""Prevent changing 'Days to Invoice in Advance' once invoices have been generated."""
Expand Down Expand Up @@ -153,7 +175,7 @@ def set_lease_status(self):
All other statuses are considered manual and are not overwritten.
"""

if self.lease_status not in get_system_controlled_statuses():
if self.lease_status and self.lease_status not in get_system_controlled_statuses():
return

status = get_status_for_lease(self)
Expand Down
Loading
Loading