Added shipping date to orders

This commit is contained in:
Frank Schubert
2021-10-29 00:01:16 +02:00
parent 5c1d75b239
commit 6ca68a60d5
3 changed files with 29 additions and 2 deletions
+26
View File
@@ -10,6 +10,7 @@ class Order extends mfBaseModel {
private $creator;
private $editor;
private $shippingdate;
public function getNewPos() {
if(!$this->id) {
@@ -47,6 +48,26 @@ class Order extends mfBaseModel {
return $terminations;
}
public function getShippingdate() {
if(!$this->id) {
return false;
}
$products = $this->getProperty("products");
if(!is_array($products) || !count($products) ) {
return false;
}
foreach($this->getProperty("products") as $product) {
if($product->cpeprovisioning) {
return $product->cpeprovisioning->shipping_date;
}
}
return false;
}
public function deletePositions() {
if(!is_array($this->getProperty("products")) || !count($this->getProperty("products"))) {
return true;
@@ -143,6 +164,11 @@ class Order extends mfBaseModel {
return $this->files;
}
if($name == "shippingdate") {
$this->shippingdate = $this->getShippingdate();
return $this->shippingdate;
}
if($name == "creator") {
$this->creator = new User($this->create_by);
return $this->creator;