Contract: Fixed finish- and cancel date by handling
This commit is contained in:
@@ -805,6 +805,19 @@ class ContractController extends mfBaseController
|
||||
$finish_date->setTimezone(new DateTimeZone("Europe/Vienna"));
|
||||
$finish_date->setTime(0, 0, 0);
|
||||
$contract_data['finish_date'] = $finish_date->getTimestamp();
|
||||
if($mode == "add") {
|
||||
$contract_data['finish_date_by'] = $this->me->id;
|
||||
} else {
|
||||
if($contract->finish_date) {
|
||||
$contract_finish_date = new DateTime("@".$contract->finish_date);
|
||||
$contract_finish_date->setTimezone(new DateTimeZone("Europe/Vienna"));
|
||||
if($contract_finish_date->format("Y-m-d") != $finish_date->format("Y-m-d")) {
|
||||
$contract_data['finish_date_by'] = $this->me->id;
|
||||
}
|
||||
} else {
|
||||
$contract_data['finish_date_by'] = $this->me->id;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$contract_data['finish_date'] = null;
|
||||
}
|
||||
@@ -814,6 +827,19 @@ class ContractController extends mfBaseController
|
||||
$cancel_date->setTimezone(new DateTimeZone("Europe/Vienna"));
|
||||
$cancel_date->setTime(0, 0, 0);
|
||||
$contract_data['cancel_date'] = $cancel_date->getTimestamp();
|
||||
if($mode == "add") {
|
||||
$contract_data['cancel_date_by'] = $this->me->id;
|
||||
} else {
|
||||
if($contract->cancel_date) {
|
||||
$contract_cancel_date = new DateTime("@".$contract->cancel_date);
|
||||
$contract_cancel_date->setTimezone(new DateTimeZone("Europe/Vienna"));
|
||||
if($contract_cancel_date->format("Y-m-d") != $cancel_date->format("Y-m-d")) {
|
||||
$contract_data['cancel_date_by'] = $this->me->id;
|
||||
}
|
||||
} else {
|
||||
$contract_data['cancel_date_by'] = $this->me->id;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$contract_data['cancel_date'] = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user