Skip to content

feat: implement property-driven lease increment automation#46

Open
iamtalib13 wants to merge 6 commits intoAakvatech-Limited:version-15from
iamtalib13:feat/property-lease-increment-automation
Open

feat: implement property-driven lease increment automation#46
iamtalib13 wants to merge 6 commits intoAakvatech-Limited:version-15from
iamtalib13:feat/property-lease-increment-automation

Conversation

@iamtalib13
Copy link
Copy Markdown

What

This PR adds property-driven lease increment automation with item-level rules and daily execution.

Why

To automate future lease item amount revisions and reduce manual increment maintenance.

Changes

Data Model

  • Added Property fields:
    • enable_auto_increment
    • increment_effective_from
    • increment_rounding_mode (Round, Ceil, Floor, None)
    • increment_rounding_precision
    • auto_create_lease_items_for_months
    • lease_increment_rules (Table)
  • Added new child doctype: Lease Increment Rule
    • lease_item
    • increment_every
    • increment_uom (Month/Year)
    • increment_type (Percent/Amount)
    • increment_value
    • rule_effective_from
    • is_active

Backend

  • Added propms/property_increment.py:
    • Property increment settings validation
    • Lease item increment generation engine
    • Supports percent and fixed-amount increments
    • Uses configured rounding mode/precision
    • Idempotent row generation (lease_item + valid_from)
    • Contextual Error Log entries on failures

Hooks & Scheduling

  • Property validation hook:
    • propms.property_increment.validate_property_increment_settings
  • Daily scheduler hook:
    • propms.property_increment.run_property_increment_engine

UI Guardrail

  • In Property form, lease_increment_rules.lease_item now filters Items by:
    • item_group = "Lease Items"

Behavior

  • Applies only to leases with lease_status = "Active" and docstatus < 2.
  • Backdated active leases are considered, but generation is forward-only from current date.
  • Requires existing base Lease Item rows in Lease for each configured rule item.

Validation

  • Manual execute tested:
    • bench --site execute propms.property_increment.run_property_increment_engine
  • Verified:
    • auto row creation works
    • increment math is correct
    • re-run is duplicate-safe
    • no runtime errors in tested flow

Commits

  • feat(property): add lease increment settings to Property doctype
  • feat(lease-increment-rule): define lease increment rule child table fields
  • feat(increment-engine): implement property-driven lease item increment automation
  • feat(hooks): wire property validation and daily increment scheduler
  • feat(property): filter increment rule items to Lease Items group

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant