Button to create Order from Preorder
This commit is contained in:
@@ -26,6 +26,7 @@ class Preorder extends mfBaseModel {
|
||||
private $statusjournals;
|
||||
private $cancel_request_status;
|
||||
private $cancel_request_creator;
|
||||
private $orderproduct;
|
||||
|
||||
protected function beforeUpdate($data) {
|
||||
if(!array_key_exists("edit_by", $data)) {
|
||||
@@ -1690,6 +1691,13 @@ class Preorder extends mfBaseModel {
|
||||
return $this->editor;
|
||||
}
|
||||
|
||||
if($name == "orderproduct") {
|
||||
$op = OrderProductModel::getFirst(["preorder_id" => $this->id]);
|
||||
if(!$op) return null;
|
||||
$this->orderproduct = $op;
|
||||
return $this->orderproduct;
|
||||
}
|
||||
|
||||
if($name == "creator") {
|
||||
$user = mfValuecache::singleton()->get("Worker-id-" . $this->create_by);
|
||||
if($user) {
|
||||
|
||||
Reference in New Issue
Block a user