Merge branch 'fronkdev' into 'master'
Fixed RimoWorkorder Remarks See merge request fronk/thetool!1067
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
use Phinx\Migration\AbstractMigration;
|
||||
|
||||
final class RimoWorkorderAddRemarks extends AbstractMigration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
if($this->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") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user