added units used to Preorder

This commit is contained in:
Frank Schubert
2022-05-11 13:23:47 +02:00
parent 6e29312363
commit 11ede6a5b7
6 changed files with 61 additions and 10 deletions

View File

@@ -65,7 +65,7 @@
<th>Straße</th>
<th>PLZ</th>
<th>Ort</th>
<th>Wohneinheiten</th>
<th>Wohneinheiten belegt</th>
<th>Code</th>
<th>OAN ID</th>
</tr>
@@ -95,7 +95,7 @@
<td class="label">
<strong><?=$preorder->building->street?></strong><br />
<strong><?=$preorder->building->zip?> <?=$preorder->building->city?></strong><br />
Wohneinheiten: <?=($preorder->building->units) ? $preorder->building->units : 1?>
Belegte Wohneinheiten: <?=$preorder->building->getUsedTerminationCount(true)?> von <?=($preorder->building->units) ? $preorder->building->units : 1?>
<?php if($preorder->building->code): ?>
<br /><?=$preorder->building->code?>
<?php endif; ?>
@@ -348,11 +348,13 @@
data.buildings.forEach(function(b) {
var line = '<tr class="result result-' + b.id + ' pointer" onclick="selectBuilding(' + b.id + ')">';
line += '<td><input type="checkbox" readonly="readonly" onclick="selectBuilding(' + b.id + ')" name="building_result_check" value="' + b.id + '" data-zip="' + b.zip + '" data-city="' + b.city + '" data-street="' + b.street + '" data-code="' + b.code + '" data-oanid="' + b.oan_id + '" data-units="' + b.units + '" /></td>';
line += "<td>" + b.street + "</td>";
line += '<td><input type="checkbox" readonly="readonly" onclick="selectBuilding(' + b.id + ')" name="building_result_check" value="' + b.id + '"';
line += 'data-zip="' + b.zip + '" data-city="' + b.city + '" data-street="' + b.street + '" data-code="' + b.code + '" data-oanid="' + b.oan_id + '" data-units="' + b.units + '" data-units-used="' + b.units_used + '" /></td>';
line += "<td>" + b.street + "</td>";
line += "<td>" + b.zip + "</td>";
line += "<td>" + b.city + "</td>";
line += "<td>" + b.units + "</td>";
line += "<td>" + b.units_used + " / " + b.units + "</td>";
line += "<td>" + b.code + "</td>";
line += "<td>" + b.oan_id + "</td>";
@@ -396,6 +398,7 @@
var code = $('input[name=building_result_check][value=' + id + ']').data("code");
var oan_id = $('input[name=building_result_check][value=' + id + ']').data("oanid");
var units = $('input[name=building_result_check][value=' + id + ']').data("units");
var units_used = $('input[name=building_result_check][value=' + id + ']').data("units-used");
$('input[name=street]').val(street);
$('input[name=zip]').val(zip);
@@ -403,7 +406,7 @@
var label = street + "<br />" + zip + " " + city;
label += "<br /><div style='font-weight: normal;'>Wohneinheiten: " + units;
label += "<br /><div style='font-weight: normal;'>Belegte Wohneinheiten: " + units_used + " von " + units;
if(code || oan_id) {
if(code) {
label += "<br />Code: " + code;