Importing missing voicenumbers & disabled ivt button in Order

This commit is contained in:
Frank Schubert
2024-07-08 01:25:06 +02:00
parent d6da19574e
commit 3f22ee7f31
3 changed files with 59 additions and 52 deletions

View File

@@ -961,17 +961,6 @@
<?php if($me->is("Admin", "netoperator")): ?>
<?php if(TT_FEATURE_IVT): ?>
<?php if($order->id && !$includes_external_product): ?>
<div class="form-group row">
<label class="col-lg-2"></label>
<div class="col-lg-10 mb-2">
<button type="button" id="savetoivt-button" class="btn btn-pink">Kunde an IVT übertragen</button>
<span id="savetoivt-info"></span>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<div class="form-group row">
<label class="col-lg-2"></label>
<div class="col-lg-10">
@@ -1135,41 +1124,7 @@
});
});
<?php if($order->id): ?>
$('#savetoivt-button').click(function() {
$('#savetoivt-button').prop("disabled", true);
$('#savetoivt-info').html("<img src='<?=self::getResourcePath()?>img/ajax-loader.gif' />");
$.get("<?=self::getUrl("IvtCustomer","create", ["order_id" => $order->id])?>",
{},
function(data) {
console.log(data);
if(data.status == "OK") {
$('#savetoivt-info').removeClass("text-danger");
$('#savetoivt-info').addClass("text-success");
$('#savetoivt-info').text("Kunde erfolgreich an IVT übertragen!");
$('#savetoivt-button').remove();
} else {
$('#savetoivt-info').removeClass("text-success");
$('#savetoivt-info').addClass("text-danger");
if(data.reason) {
if(data.reason == "no-cust-num") {
$('#savetoivt-info').text("Inhaber und/oder Rechungsempfänger hat keine Kundennummer!");
}
if(data.reason == "ivt-exist") {
$('#savetoivt-info').text("Kunde existiert bereits im IVT!");
}
} else {
$('#savetoivt-info').text("Fehler bei übertragung.");
}
$('#savetoivt-button').prop("disabled", false);
}
},
"json"
);
});
<?php endif; ?>
$('#owner_new').change(function() {
if($('#owner_new').prop('checked')) {
$('#owner-form').show();