Fehler in Abrechnungsende behoben
This commit is contained in:
@@ -14,7 +14,7 @@ class ChangeCostUnitDetailsCommand {
|
||||
|
||||
$this->request->costUnit->distance_allowance = $this->request->distanceAllowance->getAmount();
|
||||
$this->request->costUnit->mail_on_new = $this->request->mailOnNew;
|
||||
$this->request->costUnit->billing_deadline = $this->request->billingDeadline;
|
||||
$this->request->costUnit->billing_deadline = $this->request->billingDeadline?->format('Y-m-d');
|
||||
|
||||
$response->success = $this->request->costUnit->save();
|
||||
return $response;
|
||||
|
||||
@@ -17,7 +17,7 @@ class CreateCostUnitCommand {
|
||||
'name' => $this->request->name,
|
||||
'tenant' => currentTenant()->slug,
|
||||
'type' => $this->request->type,
|
||||
'billing_deadline' => $this->request->billingDeadline,
|
||||
'billing_deadline' => $this->request->billingDeadline?->format('Y-m-d'),
|
||||
'distance_allowance' => $this->request->distanceAllowance->getAmount(),
|
||||
'mail_on_new' => $this->request->mailOnNew,
|
||||
'allow_new' => true,
|
||||
|
||||
@@ -37,7 +37,10 @@ class EditController extends CommonController{
|
||||
|
||||
$saveParams = $request->get('formData');
|
||||
$distanceAllowance = Amount::fromString($saveParams['distanceAllowance']);
|
||||
$billingDeadline = isset($saveParams['billingDeadline']) ? \DateTime::createFromFormat('Y-m-d', $saveParams['billingDeadline']) : null;
|
||||
$rawBillingDeadline = $saveParams['billingDeadline'] ?? null;
|
||||
$billingDeadline = !empty($rawBillingDeadline)
|
||||
? (\DateTime::createFromFormat('!Y-m-d', $rawBillingDeadline) ?: null)
|
||||
: null;
|
||||
|
||||
$request = new ChangeCostUnitDetailsRequest($costUnit, $distanceAllowance, $saveParams['mailOnNew'], $billingDeadline);
|
||||
$command = new ChangeCostUnitDetailsCommand($request);
|
||||
|
||||
@@ -26,6 +26,18 @@ class SaveInvoiceController extends CommonController
|
||||
]);
|
||||
}
|
||||
|
||||
// Sicherheitsnetz hinter der Oberfläche: Wer gereist ist, steht im Zahlungsgrund auf Beleg und EüR und
|
||||
// ist bei Fahrtkosten Pflicht. Geprüft wird hier und nicht im Command, weil auch Abrechnungskorrekturen
|
||||
// durch den Command laufen -- sie bringen ihren Zahlungsgrund mit, aber keine Personen. Und vor dem
|
||||
// Upload, damit eine abgelehnte Einreichung keinen verwaisten Beleg hinterlässt.
|
||||
if ($invoiceType === InvoiceType::INVOICE_TYPE_TRAVELLING
|
||||
&& Validator::make($request->all(), ['travellers' => 'required|string'])->fails()) {
|
||||
return response()->json([
|
||||
'status' => 'error',
|
||||
'message' => 'Bitte gib an, welche Personen gereist sind.'
|
||||
]);
|
||||
}
|
||||
|
||||
$uploadedFile = null;
|
||||
if (null !== $request->file('receipt')) {
|
||||
$maxFileSize = env('MAX_INVOICE_FILE_SIZE', 16);
|
||||
|
||||
@@ -41,10 +41,11 @@ const travelReasonComplete = computed(() =>
|
||||
/**
|
||||
* Wer gereist ist, steht später als Zahlungsgrund in der Belegliste, auf der EüR und auf dem Beleg. Wer
|
||||
* den Beleg einreicht, war meist selbst dabei -- deshalb der eigene Name als Vorschlag. Ohne Login
|
||||
* bleibt das Feld leer, und es hält den Ablauf auch dann nicht auf: Ein Name ist eine Hilfe, keine
|
||||
* Bedingung.
|
||||
* bleibt das Feld leer; weiter geht es erst, wenn jemand eingetragen ist -- wie beim Reisegrund.
|
||||
*/
|
||||
const travellers = ref(data.userName || '');
|
||||
|
||||
const travellersComplete = computed(() => travellers.value.trim() !== '');
|
||||
const have_receipt = ref('')
|
||||
const amount = ref(0.00);
|
||||
const invoiceType = ref(null);
|
||||
@@ -121,7 +122,7 @@ function handleFileChange(event) {
|
||||
/>
|
||||
</fieldset><br /><br />
|
||||
|
||||
<fieldset v-if="travelReasonComplete">
|
||||
<fieldset v-if="travelReasonComplete && travellersComplete">
|
||||
<legend><span style="font-weight: bolder;">Bist du mit dem ÖPNV gefahren oder besitzt du einen Beleg</span></legend>
|
||||
<input type="button" style="border-radius: 0; width: 100px;" @click="have_receipt='yes'" value="Ja" />
|
||||
<input type="button" style="border-radius: 0; width: 100px;" @click="getDistanceAllowance" value="Nein" />
|
||||
@@ -129,7 +130,8 @@ function handleFileChange(event) {
|
||||
|
||||
<br /><br />
|
||||
|
||||
<fieldset v-if="have_receipt === 'yes'">
|
||||
<!-- Auch nach "Ja"/"Nein" gilt die Pflicht: Wer die Personen wieder löscht, kann nicht einreichen. -->
|
||||
<fieldset v-if="travellersComplete && have_receipt === 'yes'">
|
||||
<legend><span style="font-weight: bolder;">Wie hoch ist der Betrag?</span></legend>
|
||||
<AmountInput v-model="amount" class="width-small" id="amount" name="amount" /> Euro
|
||||
|
||||
@@ -161,7 +163,7 @@ function handleFileChange(event) {
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<fieldset v-else-if="distanceAllowance != null">
|
||||
<fieldset v-else-if="travellersComplete && distanceAllowance != null">
|
||||
<legend><span style="font-weight: bolder;">Reiseinformationen</span></legend>
|
||||
Gesamtlänge des Reisewegs:
|
||||
<NumericInput
|
||||
|
||||
Reference in New Issue
Block a user