WIP PreorderBilling 2025-03-26

This commit is contained in:
Frank Schubert
2025-03-26 14:06:23 +01:00
parent c73c2e2a86
commit e3a6d494ef
10 changed files with 195 additions and 10 deletions

View File

@@ -27,6 +27,25 @@ $pagination_entity_name = "Vorbestellungen";
max-width: 650px;
}
.is-billed-button {
padding:6px;
padding-left: 8px;
padding-right: 8px;
background-color: #25b343;
color: #fff;
}
.set-billed-button {
padding:6px;
padding-left: 8px;
padding-right: 8px;
border: 1px solid #d0d0d0;
}
.set-billed-button:hover {
background-color: #007bff;
color: #fff;
}
@media (max-width: 1720px) {
.preorder-filters .col-sm-12 {
@@ -477,7 +496,19 @@ $pagination_entity_name = "Vorbestellungen";
<span id="update-<?=$preorder->id?>"><?=date('d.m.Y H:i', $preorder->edit)?></span>
</td>
<td><?php if($preorder->adb_wohneinheit_id && is_array($preorder->adb_wohneinheit->rimo_workorders) && count($preorder->adb_wohneinheit->rimo_workorders)):?><i class="fas fa-r" title="Rimo Workorder erstellt"></i><?php endif; ?></td>
<td class="text-nowrap">
<?php if(!$me->address->hasPreorderBilling()): ?>
<?php if($preorder->adb_wohneinheit_id && $preorder->adb_wohneinheit->enduser_setup_invoice_date): ?>
<i class="fas fa-euro is-billed-button" title="Herstellungsentgelt verrechnet am <?=(new DateTime($preorder->adb_wohneinheit->enduser_setup_invoice_date))->format("d.m.Y")?>"></i>
<?php else: ?>
<a href="#" class="text-muted" onclick="setBilled(<?=$preorder->id?>)"><i class="fas fa-euro set-billed-button" title="Herstellungsentgelt als verrechnet markieren"></i></a>
<?php endif; ?>
<?php endif; ?>
<?php if($preorder->adb_wohneinheit_id && is_array($preorder->adb_wohneinheit->rimo_workorders) && count($preorder->adb_wohneinheit->rimo_workorders)):?>
<i class="fas fa-r p-1" title="Rimo Workorder erstellt"></i>
<?php endif; ?>
</td>
<td style="text-align: left; letter-spacing: 4px; font-size: 1.1em;">
<div class="preorder-campaign-table-actions">
<?php if(!$me->is(["preorderfront"]) && !$me->is("preorderreadonly")): ?>
@@ -595,6 +626,22 @@ $pagination_entity_name = "Vorbestellungen";
});
});
function setBilled(pid) {
if(!pid) return;
$.post("<?=self::getUrl("Preorder", "Api")?>", {
do: "setBilled",
id: pid
},
function(success) {
if(success.status == "OK") {
$("#preorder-" + pid + " .set-billed-button").parent().html("<i class='fas fa-euro is-billed-button' title='Herstellungsentgelt verrechnet am " + success.result.date + "'></i>");
}
},
"json"
);
}
function attributeSuccess(result) {
var id = result.id
var attribute = result.attribute

View File

@@ -98,8 +98,7 @@ $pagination_entity_name = "Billingrecords";
</div>
<div class="card">
<div class="card-body mb-3">
<div class="card-body">
<div class="row">
<div class="col-12">
<a href="<?=self::getUrl("PreorderBillingInvoice")?>" class="btn btn-outline-primary"><i class="fas fa-fw fa-list"></i> Rechnungen anzeigen</a>