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:
@@ -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") {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user