Compare commits
2 Commits
ebe8d86732
...
8d7ffb30c5
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d7ffb30c5 | |||
| cc142af834 |
@@ -0,0 +1,38 @@
|
||||
define('custom:views/c-vmh-mietverhaeltnis/fields/warmmiete', ['views/fields/currency'], function (Dep) {
|
||||
|
||||
return Dep.extend({
|
||||
|
||||
setup: function () {
|
||||
Dep.prototype.setup.call(this);
|
||||
|
||||
this.calculating = false;
|
||||
|
||||
// Listen to changes on dependent fields
|
||||
this.listenTo(this.model, 'change:kaltmiete', this.calculate.bind(this));
|
||||
this.listenTo(this.model, 'change:bKVorauszahlung', this.calculate.bind(this));
|
||||
this.listenTo(this.model, 'change:bKPauschale', this.calculate.bind(this));
|
||||
},
|
||||
|
||||
afterRender: function () {
|
||||
Dep.prototype.afterRender.call(this);
|
||||
// Don't calculate on initial render - only on changes
|
||||
},
|
||||
|
||||
calculate: function () {
|
||||
if (this.calculating) return;
|
||||
this.calculating = true;
|
||||
|
||||
var kaltmiete = parseFloat(this.model.get('kaltmiete')) || 0;
|
||||
var bKVorauszahlung = parseFloat(this.model.get('bKVorauszahlung')) || 0;
|
||||
var bKPauschale = parseFloat(this.model.get('bKPauschale')) || 0;
|
||||
|
||||
var warmmiete = kaltmiete + bKVorauszahlung + bKPauschale;
|
||||
|
||||
// Set value - this will trigger the parent view to update
|
||||
this.model.set('warmmiete', warmmiete);
|
||||
|
||||
this.calculating = false;
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
@@ -80,8 +80,6 @@
|
||||
"dynamicLogicStyled": null,
|
||||
"tabBreak": false,
|
||||
"hidden": false,
|
||||
"noteText": "Erfassen Sie die Miethöhe in ihren einzelnen Bestandteilen",
|
||||
"noteStyle": "info",
|
||||
"customLabel": "Miethöhe"
|
||||
}
|
||||
]
|
||||
@@ -63,42 +63,5 @@
|
||||
"layout": null,
|
||||
"selectPrimaryFilterName": null
|
||||
}
|
||||
},
|
||||
"dynamicLogic": {
|
||||
"fields": {
|
||||
"beendigungsTatbestand": {
|
||||
"readOnly": {
|
||||
"conditionGroup": [
|
||||
{
|
||||
"type": "equals",
|
||||
"attribute": "status",
|
||||
"value": "Bestehend"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"kndigungsgrundWohnraum": {
|
||||
"readOnly": {
|
||||
"conditionGroup": [
|
||||
{
|
||||
"type": "equals",
|
||||
"attribute": "status",
|
||||
"value": "Bestehend"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"auszugsfrist": {
|
||||
"readOnly": {
|
||||
"conditionGroup": [
|
||||
{
|
||||
"type": "equals",
|
||||
"attribute": "status",
|
||||
"value": "Bestehend"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,7 +169,8 @@
|
||||
"isCustom": true,
|
||||
"readOnly": true,
|
||||
"required": false,
|
||||
"tooltip": true
|
||||
"tooltip": true,
|
||||
"view": "custom:views/c-vmh-mietverhaeltnis/fields/warmmiete"
|
||||
},
|
||||
"vmhMietobjekt": {
|
||||
"type": "link",
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"beforeSaveCustomScript": "warmmiete = (kaltmiete ?? 0) + (bKVorauszahlung ?? 0) + (bKPauschale ?? 0);"
|
||||
}
|
||||
@@ -359,8 +359,8 @@ return [
|
||||
0 => 'youtube.com',
|
||||
1 => 'google.com'
|
||||
],
|
||||
'cacheTimestamp' => 1769206320,
|
||||
'microtime' => 1769206320.164239,
|
||||
'cacheTimestamp' => 1769206608,
|
||||
'microtime' => 1769206608.00783,
|
||||
'siteUrl' => 'https://crm.bitbylaw.com',
|
||||
'fullTextSearchMinLength' => 4,
|
||||
'appTimestamp' => 1768843902,
|
||||
|
||||
Reference in New Issue
Block a user