Zahlungszwecke
This commit is contained in:
@@ -34,6 +34,17 @@ class UpdateInvoiceCommand {
|
||||
}
|
||||
|
||||
|
||||
$purpose = trim((string) $this->request->purpose);
|
||||
$purpose = $purpose === '' ? null : $purpose;
|
||||
|
||||
// Verglichen wird gegen den angezeigten Text, nicht gegen die Spalte: Das Formular ist damit
|
||||
// vorbelegt, und wer ihn unverändert abschickt, hat nichts geändert. Ein Bestandsbeleg behält so
|
||||
// seine leere Spalte und damit die Ableitung; wer das Feld leert, schaltet zurück auf automatisch.
|
||||
if (($purpose ?? '') !== $this->request->invoice->purposeText()) {
|
||||
$changes .= 'Zahlungsgrund geändert von ' . $this->request->invoice->purposeText() . ' auf ' . ($purpose ?? '--') . '.<br />';
|
||||
$this->request->invoice->purpose = $purpose;
|
||||
}
|
||||
|
||||
$this->request->invoice->comment = $this->request->comment;
|
||||
$this->request->invoice->changes = $changes;
|
||||
|
||||
|
||||
@@ -13,9 +13,11 @@ class UpdateInvoiceRequest {
|
||||
public CostUnit $costUnit;
|
||||
public Invoice $invoice;
|
||||
public Amount $amount;
|
||||
public ?string $purpose;
|
||||
|
||||
public function __construct(Invoice $invoice, ?string $comment, InvoiceType $invoiceType, CostUnit $costUnit, Amount $amount) {
|
||||
public function __construct(Invoice $invoice, ?string $comment, InvoiceType $invoiceType, CostUnit $costUnit, Amount $amount, ?string $purpose = null) {
|
||||
$this->comment = $comment;
|
||||
$this->purpose = $purpose;
|
||||
$this->invoiceType = $invoiceType;
|
||||
$this->costUnit = $costUnit;
|
||||
$this->invoice = $invoice;
|
||||
|
||||
Reference in New Issue
Block a user