added filter for sended emails
This commit is contained in:
@@ -418,11 +418,6 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
<button type="submit" formaction="<?=self::getUrl("Preorder", "export")?>" id="export-button" class="btn btn-outline-success"><i class="fas fa-download"></i> CSV-Export</button>
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- i need a dropdown with 2 options beautifull dropdown no select
|
||||
Gelöschte Bestellungen mit Workorder (button with href)
|
||||
Wohnung - Verkabelung erledigt (button with href)
|
||||
-->
|
||||
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-outline-primary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
Filter-Vorlagen <i class="fas fa-caret-down"></i>
|
||||
@@ -430,6 +425,9 @@ $pagination_entity_name = "Vorbestellungen";
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<li><a class="dropdown-item" href="<?=self::getUrl("Preorder", "Index", ["filter" => ["status" => [21,22,23,24,25], "rimo_workorder" => 1, "borderpoint" => "all"]])?>">Gelöschte Bestellungen mit Workorder</a></li>
|
||||
<li><a class="dropdown-item" href="<?=self::getUrl("Preorder", "Index", ["filter" => ["preorder_status_flags" => [4], "connection_type" => ["apartment", "apartment-building"], "borderpoint" => "all"]])?>">Wohnung - Verkabelung erledigt</a></li>
|
||||
<?php if ($me->isAdmin() || $me->address->id == 209): ?>
|
||||
<li><a class="dropdown-item" href="<?=self::getUrl("Preorder", "Index", ["filter" => ["onlyShowCustomMailSent" => 1]])?>">Bestellungen mit gesendeter Custom-300 Benachrichtigung</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -102,7 +102,66 @@
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr><tr>
|
||||
</tr>
|
||||
|
||||
<!-- add new checkbox field here called "Verrechnet" and if $preorder->billed is not null or 0 show the unix date, also only show this when
|
||||
preordercampaign -> network_id -> network -> owner_id === 209
|
||||
|
||||
then show billed = timestamp (no input as the checkbox is the only thing that can be changed)
|
||||
also show billed_by
|
||||
|
||||
-->
|
||||
<?php if($preorder->campaign->network->owner_id === "209"): ?>
|
||||
<tr>
|
||||
<th>Verrechnet:</th>
|
||||
<td>
|
||||
<div class="flex items-center space-x-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="preorder-detail-billed-<?=$preorder->id?>"
|
||||
class="form-checkbox h-5 w-5 text-blue-600 rounded focus:ring-blue-500"
|
||||
<?=($preorder->billed) ? 'checked' : ''?>
|
||||
onchange="updatePreorderBilled(<?=$preorder->id?>, this.checked)"
|
||||
/>
|
||||
<label for="preorder-detail-billed-<?=$preorder->id?>" class="text-gray-700 mb-0">Verrechnet</label>
|
||||
</div>
|
||||
|
||||
<?php if($preorder->billed_by): ?>
|
||||
<div class="mt-2 text-sm text-gray-600" id="billed_text">Verrechnet durch: <?=(new User($preorder->billed_by))->name?> am <?=date("d.m.Y H:i", $preorder->billed)?> Uhr</div>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<script>
|
||||
// console log if changed
|
||||
function updatePreorderBilled(preorderId, isChecked) {
|
||||
console.log("Updating billed status for preorder " + preorderId + ": " + (isChecked ? "checked" : "unchecked"));
|
||||
$.ajax({
|
||||
url: '<?=self::getUrl("Preorder", "Api")?>?do=updateBilled',
|
||||
type: 'POST',
|
||||
data: {
|
||||
do: 'updateBilled',
|
||||
id: preorderId,
|
||||
billed: isChecked ? 1 : 0
|
||||
},
|
||||
success: function(response) {
|
||||
console.log("Update successful:", response);
|
||||
if (isChecked) {
|
||||
$("#billed_text").html(`Verrechnet durch: ${response.result.billed_by_name} am ${response.result.billed_date} Uhr`);
|
||||
window.notify("success", "Preorder wurde als verrechnet markiert.");
|
||||
} else {
|
||||
$("#billed_text").html("");
|
||||
window.notify("success", "Preorder wurde als nicht verrechnet markiert.");
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error("Update failed:", error);
|
||||
window.notify("error", "Fehler beim Aktualisieren des Verrechnungsstatus: " + error);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<th>Erstellt:</th>
|
||||
<td class="text-monospace"><?=date("d.m.Y H:i",$preorder->create)?> (<?=$preorder->creator->name?>)</td>
|
||||
</tr><tr>
|
||||
|
||||
Reference in New Issue
Block a user