Merge branch 'Warehouse/fix-and-improve' into 'master'

Added WarehouseOffer and WarehouseOfferTemplate, also fixed menu for Lager Point

See merge request fronk/thetool!1156
This commit is contained in:
Luca Haid
2025-03-31 13:14:15 +00:00
9 changed files with 359 additions and 132 deletions

View File

@@ -0,0 +1,71 @@
<?php declare(strict_types = 1);
use Phinx\Migration\AbstractMigration;
final class WarehouseModify16 extends AbstractMigration {
public function up(): void {
if ($this->getEnvironment() == "thetool") {
$WarehouseArticleTable = $this->table("WarehouseArticle");
$WarehouseArticleTable
->changeColumn("isEShop", "integer", ["default" => 0])
->changeColumn("isEShopHide", "integer", ["default" => 0])
->changeColumn("isSerialDocumentation", "integer", ["default" => 0])
->save();
$WarehouseOfferTable = $this->table("WarehouseOffer", ["id" => false, "primary_key" => "id"]);
$WarehouseOfferTable
->addColumn("id", "integer", ["identity" => true])
->addColumn("offerNumber", "string", ["limit" => 255, "null" => false])
->addColumn("reference", "string", ["limit" => 255, "null" => false])
->addColumn("customerNumber", "string", ["limit" => 255, "null" => false])
->addColumn("customerName", "string", ["limit" => 255, "null" => false])
->addColumn("customerStreet", "string", ["limit" => 255, "null" => false])
->addColumn("customerCity", "string", ["limit" => 255, "null" => false])
->addColumn("customerZip", "string", ["limit" => 255, "null" => false])
->addColumn("customerVAT", "string", ["limit" => 255, "null" => false])
->addColumn("editor", "integer", ["null" => false])
->addColumn("purpose", "string", ["limit" => 255, "null" => false])
->addColumn("positions", "text", ["null" => false])
->addColumn("alternativePositions", "text", ["null" => false])
->addColumn("totalDiscount", "float", ["null" => false])
->addColumn("paymentTerms", "string", ["limit" => 255, "null" => false])
->addColumn("deliveryTerms", "string", ["limit" => 255, "null" => false])
->addColumn("closingText", "text", ["null" => false])
->addColumn("notes", "string", ["limit" => 255, "null" => false])
->addColumn("status", "string", ["limit" => 255, "null" => false])
->addColumn("totalAmount", "float", ["null" => false])
->addColumn("create", "integer", ["null" => false])
->addColumn("createBy", "integer", ["null" => false])
->save();
$WarehouseOfferTemplateTable = $this->table("WarehouseOfferTemplate", ["id" => false, "primary_key" => "id"]);
$WarehouseOfferTemplateTable
->addColumn("id", "integer", ["identity" => true])
->addColumn("templateName", "string", ["limit" => 255, "null" => false])
->addColumn("positions", "text", ["null" => false])
->addColumn("totalDiscount", "float", ["null" => false])
->addColumn("paymentTerms", "string", ["limit" => 255, "null" => false])
->addColumn("deliveryTerms", "string", ["limit" => 255, "null" => false])
->addColumn("closingText", "text", ["null" => false])
->addColumn("notes", "text", ["null" => false])
->save();
}
}
public function down(): void {
if ($this->getEnvironment() == "thetool") {
// change table "WarehouseArticle" and set isEShop, isEShopHide, isSerialDocumentation to no default
$WarehouseArticleTable = $this->table("WarehouseArticle");
$WarehouseArticleTable
->changeColumn("isEShop", "integer", ["default" => null])
->changeColumn("isEShopHide", "integer", ["default" => null])
->changeColumn("isSerialDocumentation", "integer", ["default" => null])
->save();
$this->table("WarehouseOffer")->drop()->save();
$this->table("WarehouseOfferTemplate")->drop()->save();
}
}
}