Tweaks to Ivt Import

This commit is contained in:
Frank Schubert
2024-07-07 21:08:32 +02:00
parent 0913f367ec
commit e49d47ed7d
2 changed files with 45 additions and 12 deletions

View File

@@ -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"]);