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
@@ -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");
}