From 6250a3baaa7d1d9570c3f75e17357ea06a91e10d Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Wed, 5 Mar 2025 15:06:52 +0100 Subject: [PATCH 1/2] added Rimoworkorder remark column --- ...50304145421_rimo_workorder_add_remarks.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 db/migrations/20250304145421_rimo_workorder_add_remarks.php diff --git a/db/migrations/20250304145421_rimo_workorder_add_remarks.php b/db/migrations/20250304145421_rimo_workorder_add_remarks.php new file mode 100644 index 000000000..f0a9da81e --- /dev/null +++ b/db/migrations/20250304145421_rimo_workorder_add_remarks.php @@ -0,0 +1,33 @@ +getEnvironment() == "thetool") { + $table = $this->table("RimoWorkorder"); + $table->addColumn("remarks", "text", ["null" => true, "after" => "rimo_team_name"]); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $table = $this->table("RimoWorkorder"); + $table->removeColumn("remarks"); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +} From 50bccc23f63ca171d5fcff1365c0d28578c6adca Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Wed, 5 Mar 2025 15:12:24 +0100 Subject: [PATCH 2/2] Fixed RimoWorkorder Remarks --- application/Preorder/PreorderController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/application/Preorder/PreorderController.php b/application/Preorder/PreorderController.php index 10b43857d..d7eada23b 100644 --- a/application/Preorder/PreorderController.php +++ b/application/Preorder/PreorderController.php @@ -1091,16 +1091,19 @@ class PreorderController extends mfBaseController { return false; } + if(!$new_remark) return false; + + $new_remark = date("d.m.Y").": ".$new_remark; + // upload remark to Rimo if(!Rimoapi::addRemark($workorder->rimo_id, $new_remark)) { return false; } - $remarks = $workorder->remarks; - if($remarks) { - $remarks .= "\n"; + $remarks = $new_remark; + if($workorder->remarks) { + $remarks = $workorder->remarks."\n$new_remark"; } - $remarks .= date("d.m.Y").": ".$new_remark; $workorder->remarks = $remarks; $workorder->save();