Merge branch 'ManualInvoice/add-new' into 'master'

Add Gutschrift functionality to ManualInvoice with modal and backend support

See merge request fronk/thetool!1921
This commit is contained in:
Luca Haid
2025-12-02 14:48:02 +00:00
8 changed files with 703 additions and 1253 deletions

View File

@@ -0,0 +1,50 @@
<?php
declare(strict_types=1);
use Phinx\Migration\AbstractMigration;
final class AddManualInvoiceStatusAndCreditFields extends AbstractMigration
{
public function up(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("ManualInvoice");
$table->addColumn("status", "enum", [
"values" => ["draft", "finalized", "exported"],
"default" => "draft",
"null" => false,
"after" => "date_delivered"
]);
$table->addColumn("credit_for_invoice_id", "integer", [
"null" => true,
"default" => null,
"after" => "status"
]);
$table->addIndex(["credit_for_invoice_id"], ["name" => "credit_for_invoice_id"]);
$table->update();
}
if ($this->getEnvironment() == "addressdb") {
}
}
public function down(): void
{
if ($this->getEnvironment() == "thetool") {
$table = $this->table("ManualInvoice");
$table->removeColumn("status");
$table->removeColumn("credit_for_invoice_id");
$table->update();
}
if ($this->getEnvironment() == "addressdb") {
}
}
}
?>