Added Button to create RimoWorkorder for legacytransfer Preorders

This commit is contained in:
Frank Schubert
2024-11-14 17:35:53 +01:00
parent c5752de7b7
commit 667027c0f1
4 changed files with 152 additions and 2 deletions
+47
View File
@@ -1014,6 +1014,53 @@
'json');
}
function createWorkorder(pid) {
if(!Number.isInteger(pid) || pid < 1) {
return false;
}
$.post("<?=self::getUrl("Preorder","Api")?>",
{
'do': "createWorkorder",
id: pid,
},
function(success) {
if(success.status == "OK") {
wo = success.result;
html = '<h4> \
' + wo.name + ' \
<a href="<?=self::getUrl("RimoWorkorder", "downloadAh")?>?id=' + wo.id + '" onclick="event.preventDefault(); downloadWorkorderAha(' + wo.id + ');"><i class="fas fa-fw fa-file-download ml-2"></i> AHA Blatt</a> \
</h4> \
<table class="table table-sm table-striped" id="preorder-detail-' + wo.preorder_id + '-workorder-' + wo.id + '"> \
<tr> \
<th>Name</th> \
<td class="text-monospace">' + wo.name + '</td> \
</tr><tr> \
<th>External ID</th> \
<td class="text-monospace">' + wo.external_id + '</td> \
</tr><tr> \
<th>Status</th> \
<td>' + wo.status + '</td> \
</tr> \
<tr> \
<th>Zugewiesen an:</th> \
<td>' + wo.assigned_to + '</td> \
</tr> \
<tr> \
<th>Erstellt</th> \
<td class="text-monospace">' + wo.created + '</td> \
</tr> \
</table>';
$("#preorder-detail-" + wo.preorder_id + "-rimo .workorder-container").append(html);
$("button.create-workorder").remove();
}
},
'json');
return false;
}
function deleteWorkorder(pid, wid) {
//console.log("in delete workorder");
if(!Number.isInteger(pid) || pid < 1) {