changed default finish_date in Order to shippingdate if available

This commit is contained in:
Frank Schubert
2022-01-11 19:25:08 +01:00
parent dfb33e1989
commit 9ec4aa9a00
3 changed files with 220 additions and 7 deletions

View File

@@ -2,7 +2,12 @@
$term_id = $order->terminations[0]->id;
$op = OrderProductModel::getFirst(['order_id' => $order->id, 'termination_id' => $term_id]);
$billing_start = date('U');
if($order->finish_date) {
$billing_start = $order->finish_date;
} else {
$billing_start = date('U');
}
if($op->billing_delay) {
$billing_start = strtotime("+".$op->billing_delay." months");
}

View File

@@ -665,7 +665,11 @@
<div class="form-group row" id="finish_date_field">
<label class="col-lg-2 col-form-label" for="finish_date">Abgeschlossen am</label>
<div class="col-lg-4">
<input type="text" class="form-control" name="finish_date" id="finish_date" value="<?=($order->finish_date) ? date("d.m.Y", $order->finish_date) : date("d.m.Y")?>" />
<?php if($order->shippingdate): ?>
<input type="text" class="form-control" name="finish_date" id="finish_date" value="<?=date("d.m.Y", $order->shippingdate)?>" />
<?php else: ?>
<input type="text" class="form-control" name="finish_date" id="finish_date" value="<?=($order->shippingdate ? $order->shippingdate : $order->finish_date) ? date("d.m.Y", $order->finish_date) : date("d.m.Y")?>" />
<?php endif; ?>
</div>
</div>
<?php endif; ?>