DeliveryConfirmation: Add user editable Text
This commit is contained in:
@ -29,7 +29,7 @@
|
|||||||
<th colspan="2">Gradation</th>
|
<th colspan="2">Gradation</th>
|
||||||
<th colspan="2">Flächenbindung</th>
|
<th colspan="2">Flächenbindung</th>
|
||||||
<th>Gewicht</th>
|
<th>Gewicht</th>
|
||||||
<th>Davon<br/>abwerten</th>
|
<th>Davon<br/>abzuwerten</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th>[°Oe]</th>
|
<th>[°Oe]</th>
|
||||||
@ -90,5 +90,9 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<!-- TODO add Gesamtlieferung tabelle -->
|
<!-- TODO add Gesamtlieferung tabelle -->
|
||||||
<!-- TODO add Freitext -->
|
<div class="text" style="margin-top: 2em;">
|
||||||
|
@if (Model.Text != null) {
|
||||||
|
<p class="comment" style="white-space: pre-wrap; break-inside: avoid;">@Model.Text</p>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
@ -9,12 +9,14 @@ namespace Elwig.Documents {
|
|||||||
|
|
||||||
public int Year;
|
public int Year;
|
||||||
public IEnumerable<DeliveryPart> Deliveries;
|
public IEnumerable<DeliveryPart> Deliveries;
|
||||||
|
public string? Text = App.Client.TextDeliveryConfirmation;
|
||||||
|
|
||||||
public DeliveryConfirmation(AppDbContext ctx, int year, Member m) :
|
public DeliveryConfirmation(AppDbContext ctx, int year, Member m) :
|
||||||
base($"Anlieferungsbestätigung {year} – {((IAddress?)m.BillingAddress ?? m).Name}", m) {
|
base($"Anlieferungsbestätigung {year} – {((IAddress?)m.BillingAddress ?? m).Name}", m) {
|
||||||
Year = year;
|
Year = year;
|
||||||
ShowDateAndLocation = true;
|
ShowDateAndLocation = true;
|
||||||
UseBillingAddress = true;
|
UseBillingAddress = true;
|
||||||
|
IncludeSender = true;
|
||||||
// FIXME footer in merged documents
|
// FIXME footer in merged documents
|
||||||
//DocumentId = $"Anl.-Best. {Year}/{m.MgNr}";
|
//DocumentId = $"Anl.-Best. {Year}/{m.MgNr}";
|
||||||
Deliveries = ctx.DeliveryParts.FromSqlRaw($"""
|
Deliveries = ctx.DeliveryParts.FromSqlRaw($"""
|
||||||
|
@ -134,7 +134,7 @@
|
|||||||
}
|
}
|
||||||
</main>
|
</main>
|
||||||
@for (int i = 0; i < 2; i++) {
|
@for (int i = 0; i < 2; i++) {
|
||||||
<div class="@(i == 0 ? "hidden" : "bottom")">
|
<div class="text @(i == 0 ? "hidden" : "bottom")">
|
||||||
@if (Model.Text != null) {
|
@if (Model.Text != null) {
|
||||||
<p class="comment">@Model.Text</p>
|
<p class="comment">@Model.Text</p>
|
||||||
}
|
}
|
||||||
|
@ -58,6 +58,7 @@ namespace Elwig.Helpers {
|
|||||||
public int ModeDeliveryNoteStats;
|
public int ModeDeliveryNoteStats;
|
||||||
|
|
||||||
public string? TextDeliveryNote;
|
public string? TextDeliveryNote;
|
||||||
|
public string? TextDeliveryConfirmation;
|
||||||
|
|
||||||
public ClientParameters(AppDbContext ctx) : this(ctx.ClientParameters.ToDictionary(e => e.Param, e => e.Value)) { }
|
public ClientParameters(AppDbContext ctx) : this(ctx.ClientParameters.ToDictionary(e => e.Param, e => e.Value)) { }
|
||||||
|
|
||||||
@ -100,6 +101,9 @@ namespace Elwig.Helpers {
|
|||||||
|
|
||||||
Sender2 = parameters.GetValueOrDefault("DOCUMENT_SENDER") ?? "";
|
Sender2 = parameters.GetValueOrDefault("DOCUMENT_SENDER") ?? "";
|
||||||
TextDeliveryNote = parameters.GetValueOrDefault("TEXT_DELIVERYNOTE");
|
TextDeliveryNote = parameters.GetValueOrDefault("TEXT_DELIVERYNOTE");
|
||||||
|
if (TextDeliveryNote == "") TextDeliveryNote = null;
|
||||||
|
TextDeliveryConfirmation = parameters.GetValueOrDefault("TEXT_DELIVERYCONFIRMATION");
|
||||||
|
if (TextDeliveryConfirmation == "") TextDeliveryConfirmation = null;
|
||||||
} catch {
|
} catch {
|
||||||
throw new KeyNotFoundException();
|
throw new KeyNotFoundException();
|
||||||
}
|
}
|
||||||
@ -138,6 +142,7 @@ namespace Elwig.Helpers {
|
|||||||
("MODE_DELIVERYNOTE_STATS", deliveryNoteStats),
|
("MODE_DELIVERYNOTE_STATS", deliveryNoteStats),
|
||||||
("DOCUMENT_SENDER", Sender2),
|
("DOCUMENT_SENDER", Sender2),
|
||||||
("TEXT_DELIVERYNOTE", TextDeliveryNote),
|
("TEXT_DELIVERYNOTE", TextDeliveryNote),
|
||||||
|
("TEXT_DELIVERYCONFIRMATION", TextDeliveryConfirmation),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -241,6 +241,17 @@
|
|||||||
</GroupBox>
|
</GroupBox>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
<GroupBox Header="Anlieferungsbestätigung" Margin="10,10,10,10" Height="250">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
|
<TextBox x:Name="TextElementDeliveryConfirmation" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" AcceptsReturn="True"
|
||||||
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10,10,10,10" Height="Auto"
|
||||||
|
TextChanged="TextBox_TextChanged"/>
|
||||||
|
</Grid>
|
||||||
|
</GroupBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
@ -208,6 +208,7 @@ namespace Elwig.Windows {
|
|||||||
case 2: ModeDeliveryNoteShort.IsChecked = true; break;
|
case 2: ModeDeliveryNoteShort.IsChecked = true; break;
|
||||||
case 3: ModeDeliveryNoteFull.IsChecked = true; break;
|
case 3: ModeDeliveryNoteFull.IsChecked = true; break;
|
||||||
}
|
}
|
||||||
|
TextElementDeliveryConfirmation.Text = p.TextDeliveryConfirmation;
|
||||||
|
|
||||||
FinishInputFilling();
|
FinishInputFilling();
|
||||||
}
|
}
|
||||||
@ -232,6 +233,7 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
p.TextDeliveryNote = TextElementDeliveryNote.Text.Length > 0 ? TextElementDeliveryNote.Text : null;
|
p.TextDeliveryNote = TextElementDeliveryNote.Text.Length > 0 ? TextElementDeliveryNote.Text : null;
|
||||||
p.ModeDeliveryNoteStats = (ModeDeliveryNoteNone.IsChecked == true) ? 0 : (ModeDeliveryNoteGaOnly.IsChecked == true) ? 1 : (ModeDeliveryNoteShort.IsChecked == true) ? 2 : (ModeDeliveryNoteFull.IsChecked == true) ? 3 : 2;
|
p.ModeDeliveryNoteStats = (ModeDeliveryNoteNone.IsChecked == true) ? 0 : (ModeDeliveryNoteGaOnly.IsChecked == true) ? 1 : (ModeDeliveryNoteShort.IsChecked == true) ? 2 : (ModeDeliveryNoteFull.IsChecked == true) ? 3 : 2;
|
||||||
|
p.TextDeliveryConfirmation = TextElementDeliveryConfirmation.Text.Length > 0 ? TextElementDeliveryConfirmation.Text : null;
|
||||||
|
|
||||||
await p.UpdateValues();
|
await p.UpdateValues();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user