diff --git a/site/models/customer.php b/site/models/customer.php index efaeb19..31f87f7 100644 --- a/site/models/customer.php +++ b/site/models/customer.php @@ -192,6 +192,13 @@ class Customer extends AppModel { } $id = $this->id; + // Appears that $this->save() "helpfully" choses to add in + // any missing data fields, populated with default values. + // So, after saving is complete, the fields 'lease_count', + // 'past_lease_count', and 'current_lease_count' have all + // been reset to zero. Gee, thanks Cake... + $this->update($id); + // Remove all associated Customer Contacts, as it ensures // any entries deleted by the user actually get deleted // in the system. We'll recreate the needed ones anyway.