WIP Preorderlogistcs: qr done, plog saving done, Preorder status change
done
This commit is contained in:
@@ -35,17 +35,17 @@
|
||||
<?php if($me->is("preorderfront")): ?>
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_kunde">Kunde (Name oder Adresse)</label>
|
||||
<input type="text" class="form-control" name="filter[kunde]" id="filter_kunde" value="<?=$filter['kunde']?>" />
|
||||
<input type="text" class="form-control" name="filter[kunde]" id="filter_kunde" value="<?=$filter['kunde'] ?? ""?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_address">Anschlussadresse</label>
|
||||
<input type="text" class="form-control" name="filter[address]" id="filter_address" value="<?=$filter['address']?>" />
|
||||
<input type="text" class="form-control" name="filter[address]" id="filter_address" value="<?=$filter['address'] ?? ""?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_hausnummer">Hausnummer</label>
|
||||
<input type="text" class="form-control" name="filter[hausnummer]" id="filter_hausnummer" value="<?=$filter['hausnummer']?>" />
|
||||
<input type="text" class="form-control" name="filter[hausnummer]" id="filter_hausnummer" value="<?=$filter['hausnummer'] ?? ""?>" />
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="col-2">
|
||||
|
||||
@@ -42,6 +42,15 @@
|
||||
<input type="text" class="form-control" name="filter[oaid]" id="filter_oaid" value="<?=$filter['oaid'] ?? ""?>" />
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_sent">Status</label>
|
||||
<select name="filter[sent]" id="filter_sent" class="form-control">
|
||||
<option value="no">Noch nicht versendet</option>
|
||||
<option value="yes" <?=(is_array($filter) && array_key_exists("sent", $filter) && intval($filter['sent']) === 1) ? "selected='selected'" : ""?>>Versendet</option>
|
||||
<option value="all" <?=(is_array($filter) && array_key_exists("sent", $filter) && $filter['sent'] == "all") ? "selected='selected'" : ""?>>Alle</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="col-2">
|
||||
<label class="form-label" for="filter_address">Anschlussadresse</label>
|
||||
<input type="text" class="form-control" name="filter[address]" id="filter_address" value="<?=$filter['address'] ?? ""?>" />
|
||||
@@ -52,6 +61,7 @@
|
||||
<input type="text" class="form-control" name="filter[kunde]" id="filter_kunde" value="<?=$filter['kunde'] ?? ""?>" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -99,7 +109,11 @@
|
||||
<tr class="preorder-list-tr" id="preorder-<?=$preorder->id?>">
|
||||
<td class="text-right align-middle"><button type="button" class="btn btn-sm btn-success font-weight-bold" onclick="printShippingSlip(<?=$preorder->id?>)"><i class="fas fa-fw fa-print"></i> DRUCKEN</button> </td>
|
||||
<td class="text-center align-middle">
|
||||
<label>Versandt <i class="fas fa-check text-success hidden"></i><input type="checkbox" class="form-control pointer" name="sent" value="1" id="sent-<?=$preorder->id?>" /></label>
|
||||
<label>Versandt <i class="fas fa-check text-success hidden" id="sent-label-<?=$preorder->id?>"></i>
|
||||
<input type="checkbox" class="form-control pointer" name="sent" value="1"
|
||||
id="sent-<?=$preorder->id?>" <?=($preorder->logistics && $preorder->logistics->sent) ? "checked='checked'" : ""?>
|
||||
onchange="saveSent(<?=$preorder->id?>)" />
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<?php if($preorder->adb_hausnummer_id): ?>
|
||||
@@ -150,6 +164,32 @@
|
||||
w.print();
|
||||
}
|
||||
|
||||
function saveSent(id) {
|
||||
if(!id) return;
|
||||
var checked = $("#sent-" + id).is(":checked");
|
||||
console.log(checked);
|
||||
|
||||
if(checked) {
|
||||
var sent = 1;
|
||||
} else {
|
||||
var sent = 0;
|
||||
}
|
||||
|
||||
$.post("<?=self::getUrl("Preorderlogistics", "Api")?>", {
|
||||
do: "saveSent",
|
||||
id: id,
|
||||
sent: sent
|
||||
},
|
||||
function(success) {
|
||||
console.log(success);
|
||||
if(success.status == "OK") {
|
||||
$("#sent-label-" + success.result.preorder_id).show();
|
||||
}
|
||||
},
|
||||
"json"
|
||||
);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?php include(realpath(dirname(__FILE__)."/../../$mfLayoutPackage")."/footer.php"); ?>
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<div style="height:1.5pt;"></div>
|
||||
|
||||
<div>
|
||||
<img src="<?=self::getResourcePath()?>assets/images/qr-placeholder.png" />
|
||||
<img src="<?=$qr_url?>" />
|
||||
</div>
|
||||
|
||||
<div style="height:1.5pt;"></div>
|
||||
@@ -75,7 +75,7 @@
|
||||
<div>
|
||||
<p>Mit besten Grüßen,</p>
|
||||
|
||||
<p>RML Infrastruktur Liezen</p>
|
||||
<p><?=$preorder->campaign->network->owner->getCompanyOrName()?></p>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user