Added Button to create RimoWorkorder for legacytransfer Preorders
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user