Added shipping date to orders
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user