Billing Import button disables all elements

This commit is contained in:
Frank Schubert
2025-07-04 15:03:34 +02:00
parent 113f1820d5
commit f16103fb53

View File

@@ -112,9 +112,10 @@ $pagination_entity_name = "Billingrecords";
<!--button type="submit" class="btn btn-primary"><i class="fas fa-fw fa-check"></i> Markierte Elemente als Contract übernehmen</button-->
</div>
<div class="float-right">
<a class="btn btn-outline-primary mb-2" href="<?=self::getUrl("Billing", "importContracts")?>">
<button class="btn btn-outline-primary mb-2" onclick="startBilling(event)">
<i class="fas fa-fw fa-file-import"></i> Rechnungsdatensätze aus Contracts erstellen
</a>
</button>
<img src="img/ajax-loader.gif" class="float-right mr-2 hidden" id="billing-loader" />
</div>
</div>
</div>
@@ -249,5 +250,19 @@ $pagination_entity_name = "Billingrecords";
todayBtn: 'linked',
autoclose: true
});
function startBilling(e) {
e.preventDefault();
if(!confirm("Wirklich Billinglauf starten?")) {
return false;
}
$('button, input').prop('disabled', true);
$('a').removeAttr("href");
$("#billing-loader").show();
window.location.href = "<?=self::getUrl("Billing", "importContracts")?>";
return false;
}
</script>
<?php include(realpath(dirname(__FILE__) . "/../../$mfLayoutPackage") . "/footer.php"); ?>