Changed to contractqueue and contract
This commit is contained in:
@@ -32,6 +32,7 @@ class Contract extends mfBaseModel {
|
||||
private $vatgroup;
|
||||
private $vatrate;
|
||||
private $voicenumbers;
|
||||
private $files;
|
||||
private $finisher;
|
||||
private $canceler;
|
||||
private $creator;
|
||||
@@ -305,8 +306,28 @@ class Contract extends mfBaseModel {
|
||||
]);
|
||||
$journal->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function addJournalFromOrder() {
|
||||
if(!$this->orderproduct_id) {
|
||||
return true;
|
||||
}
|
||||
$order = $this->getProperty("orderproduct")->order;
|
||||
if(!$order || !$order->id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
foreach($order->journals as $order_journal) {
|
||||
$journal = ContractjournalModel::create([
|
||||
'contract_id' => $this->id,
|
||||
'type' => "text",
|
||||
'value' => "",
|
||||
'text' => $order_journal->text
|
||||
]);
|
||||
$journal->save();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getVoicenumbers() {
|
||||
@@ -589,6 +610,14 @@ class Contract extends mfBaseModel {
|
||||
}
|
||||
return $this->$name;
|
||||
}
|
||||
if($name == "files") {
|
||||
$files = ContractFileModel::search(["contract_id" => $this->id]);
|
||||
if($files) {
|
||||
$this->files = $files;
|
||||
return $this->files;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
if($name == "finisher") {
|
||||
$this->finisher = mfValuecache::singleton()->get("Worker-id-" . $this->finish_date_by);
|
||||
|
||||
Reference in New Issue
Block a user