Tweaks to Ivt Import
This commit is contained in:
@@ -15,6 +15,7 @@ class Contract extends mfBaseModel {
|
||||
private $configvalues;
|
||||
private $isCancelled;
|
||||
private $journals;
|
||||
private $orderjournals;
|
||||
private $links;
|
||||
private $linksWithCredit;
|
||||
private $linkFrom;
|
||||
@@ -333,6 +334,24 @@ class Contract extends mfBaseModel {
|
||||
$this->journals = array_reverse(ContractjournalModel::search(["contract_id" => $this->id]));
|
||||
return $this->journals;
|
||||
}
|
||||
|
||||
if($name == "orderjournals") {
|
||||
if(!$this->orderproduct_id) return null;
|
||||
|
||||
$journals = [];
|
||||
|
||||
$order = $this->getProperty("orderproduct")->order;
|
||||
foreach($order->journal as $j) {
|
||||
$oj = new Contractjournal();
|
||||
$oj->type = "order_comment";
|
||||
$oj->value = "";
|
||||
$oj->text = $j->text;
|
||||
$journals[] = $oj;
|
||||
}
|
||||
|
||||
$this->orderjournals = $journals;
|
||||
return $this->orderjournals;
|
||||
}
|
||||
|
||||
if($name == "links") {
|
||||
$this->links = ContractLinkModel::includesContractId($this->id, ["type" => "link"]);
|
||||
|
||||
Reference in New Issue
Block a user