chore(booking): Bezahlt-Kennzeichen per Migration entfernen
Migration 011 droppt bookings.paid portabel (MySQL/MariaDB), damit Neuinstallationen ohne die Spalte nicht abbrechen.
This commit is contained in:
parent
11bb83c66c
commit
7c0a7c7cd4
2 changed files with 24 additions and 1 deletions
21
sql/migrations/011_booking_paid_entfernen.sql
Normal file
21
sql/migrations/011_booking_paid_entfernen.sql
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
-- Rücknahme des Bezahlt-Kennzeichens (Migration 010).
|
||||
--
|
||||
-- Die Kundenrundmail wählt ihre Empfänger nicht mehr über ein Zahlungs-Flag,
|
||||
-- sondern über Buchungen der letzten 13 Monate, die nicht storniert sind.
|
||||
-- Das Feld wird daher wieder entfernt. Die Abfrage ist portabel (MySQL und
|
||||
-- MariaDB), damit Neuinstallationen ohne die Spalte nicht abbrechen.
|
||||
|
||||
SET @dic_sql = (
|
||||
SELECT IF(
|
||||
COUNT(*) > 0,
|
||||
'ALTER TABLE bookings DROP COLUMN paid',
|
||||
'DO 0'
|
||||
)
|
||||
FROM information_schema.COLUMNS
|
||||
WHERE TABLE_SCHEMA = DATABASE()
|
||||
AND TABLE_NAME = 'bookings'
|
||||
AND COLUMN_NAME = 'paid'
|
||||
);
|
||||
PREPARE dic_stmt FROM @dic_sql;
|
||||
EXECUTE dic_stmt;
|
||||
DEALLOCATE PREPARE dic_stmt;
|
||||
|
|
@ -64,7 +64,8 @@ $backUrl = $isEdit ? '/bookings/' . (int) $booking['id'] : '/calendar';
|
|||
<?php endif; ?>
|
||||
|
||||
<form class="booking-form" method="post" action="<?= e(url($isEdit ? '/bookings/' . (int) $booking['id'] . '/edit' : '/bookings/new')) ?>"
|
||||
data-booking-form data-availability-url="<?= e(url('/api/availability')) ?>" data-exclude="<?= $isEdit ? (int) $booking['id'] : 0 ?>">
|
||||
data-booking-form data-mode="<?= $isEdit ? 'edit' : 'new' ?>"
|
||||
data-availability-url="<?= e(url('/api/availability')) ?>" data-exclude="<?= $isEdit ? (int) $booking['id'] : 0 ?>">
|
||||
<?= csrf_field() ?>
|
||||
|
||||
<div class="form-layout">
|
||||
|
|
@ -239,6 +240,7 @@ $backUrl = $isEdit ? '/bookings/' . (int) $booking['id'] : '/calendar';
|
|||
<em class="muted small">Nummer eintragen setzt „Rechnung: JA" automatisch. „Nein" bleibt ohne Nummer.</em>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="field">
|
||||
<span>Noch zu zahlen</span>
|
||||
<output class="due-output" data-due><?= e(fmt_money(due_cents(parse_money((string) $values['rent']) + parse_money((string) $values['delivery']), parse_money((string) $values['deposit'])))) ?></output>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue