Compare commits
82 Commits
v0.6.0
..
42eb68d431
| Author | SHA1 | Date | |
|---|---|---|---|
| 42eb68d431 | |||
| 0591d91f49 | |||
| befe6a753b | |||
| 4daa6deb26 | |||
| c07a6b450c | |||
| 6fdd72e28b | |||
| 6af33c591f | |||
| f850fd08ff | |||
| b063b201e3 | |||
| 60b624b009 | |||
| 71a234ca60 | |||
| 38abfb0edd | |||
| 05a037db70 | |||
| b9287f8260 | |||
| 50ac757067 | |||
| c6cd9d7c73 | |||
| 1b28752f4c | |||
| e0bdbee2ae | |||
| ff3bd5cea5 | |||
| 116d88d3d6 | |||
| 6bcb2fb406 | |||
| 8665c93702 | |||
| 62496a0770 | |||
| 8678a02318 | |||
| 9de7fad139 | |||
| 85c8783f7e | |||
| 75e02751f0 | |||
| ef1c3b25cf | |||
| 255953a658 | |||
| 9470b26aec | |||
| 3a2bf81bd9 | |||
| d3aca196dd | |||
| 519e903d1c | |||
| dd568b81e8 | |||
| 31b0ae245d | |||
| 46498ce337 | |||
| 0fff698a5d | |||
| a71c6685f0 | |||
| ab41702f6c | |||
| 2bbf4dd1fd | |||
| 8909b4a3a8 | |||
| f8d776c028 | |||
| 2154e253ad | |||
| df83430c35 | |||
| d59a713a8c | |||
| 5e48d8e8d1 | |||
| 4f95d3fe16 | |||
| ce3185842a | |||
| e1d19fd9e5 | |||
| 3931a4084c | |||
| 1a492e4eff | |||
| 58a13eb3cc | |||
| d5124829de | |||
| 37658869e4 | |||
| 24a43ff37d | |||
| 16cf055834 | |||
| ef0b913063 | |||
| 05909919e2 | |||
| 3642c5ac07 | |||
| 6cee604448 | |||
| 89d20f4c42 | |||
| 182b367811 | |||
| a2bb09cfbd | |||
| b981b5f895 | |||
| 9dc2e8a59a | |||
| 1dc05e47cf | |||
| 21cc20ee63 | |||
| 491c41b239 | |||
| 47658a72ae | |||
| 8b0a4d7979 | |||
| 9ee7f6baf1 | |||
| ecbc9c2d82 | |||
| bf90543ad8 | |||
| 6a5676f916 | |||
| 75e9d756d2 | |||
| ee161b149b | |||
| 0cb7b4bfc8 | |||
| 4a49a17b6a | |||
| 741ccaacae | |||
| 19f4300440 | |||
| 954c7a8bdb | |||
| 626724fe87 |
+1
-1
@@ -3,4 +3,4 @@ bin/
|
|||||||
*.user
|
*.user
|
||||||
.vs
|
.vs
|
||||||
.idea
|
.idea
|
||||||
Tests/Resources/Create.sql
|
Tests/Resources/Sql/Create.sql
|
||||||
|
|||||||
+1
-1
@@ -53,7 +53,7 @@ namespace Elwig {
|
|||||||
public static string? BranchFaxNr { get; private set; }
|
public static string? BranchFaxNr { get; private set; }
|
||||||
public static string? BranchMobileNr { get; private set; }
|
public static string? BranchMobileNr { get; private set; }
|
||||||
public static IList<IScale> Scales { get; private set; }
|
public static IList<IScale> Scales { get; private set; }
|
||||||
public static ClientParameters Client { get; private set; }
|
public static ClientParameters Client { get; set; }
|
||||||
|
|
||||||
public static bool IsPrintingReady => Html.IsReady && Pdf.IsReady;
|
public static bool IsPrintingReady => Html.IsReady && Pdf.IsReady;
|
||||||
public static Dispatcher MainDispatcher { get; private set; }
|
public static Dispatcher MainDispatcher { get; private set; }
|
||||||
|
|||||||
@@ -119,6 +119,11 @@ main h1 {
|
|||||||
font-size: 10pt;
|
font-size: 10pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.main-wrapper p.custom {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
break-inside: avoid;
|
||||||
|
}
|
||||||
|
|
||||||
.main-wrapper .hidden {
|
.main-wrapper .hidden {
|
||||||
break-before: avoid;
|
break-before: avoid;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Elwig.Documents {
|
|||||||
|
|
||||||
public PaymentMember? Payment;
|
public PaymentMember? Payment;
|
||||||
public Credit? Credit;
|
public Credit? Credit;
|
||||||
public CreditNoteData Data;
|
public CreditNoteDeliveryData Data;
|
||||||
public string? Text;
|
public string? Text;
|
||||||
public string CurrencySymbol;
|
public string CurrencySymbol;
|
||||||
public int Precision;
|
public int Precision;
|
||||||
@@ -20,7 +20,15 @@ namespace Elwig.Documents {
|
|||||||
public decimal MemberTotalUnderDelivery;
|
public decimal MemberTotalUnderDelivery;
|
||||||
public decimal MemberAutoBusinessShares;
|
public decimal MemberAutoBusinessShares;
|
||||||
|
|
||||||
public CreditNote(AppDbContext ctx, PaymentMember p, CreditNoteData data, Dictionary<string, UnderDelivery>? underDeliveries = null) :
|
public CreditNote(
|
||||||
|
AppDbContext ctx,
|
||||||
|
PaymentMember p,
|
||||||
|
CreditNoteDeliveryData data,
|
||||||
|
bool considerContractPenalties,
|
||||||
|
bool considerTotalPenalty,
|
||||||
|
bool considerAutoBusinessShares,
|
||||||
|
Dictionary<string, UnderDelivery>? underDeliveries = null
|
||||||
|
) :
|
||||||
base($"{Name} {(p.Credit != null ? $"Nr. {p.Credit.Year}/{p.Credit.TgNr:000}" : p.Member.Name)} – {p.Variant.Name}", p.Member) {
|
base($"{Name} {(p.Credit != null ? $"Nr. {p.Credit.Year}/{p.Credit.TgNr:000}" : p.Member.Name)} – {p.Variant.Name}", p.Member) {
|
||||||
UseBillingAddress = true;
|
UseBillingAddress = true;
|
||||||
ShowDateAndLocation = true;
|
ShowDateAndLocation = true;
|
||||||
@@ -34,39 +42,46 @@ namespace Elwig.Documents {
|
|||||||
} else {
|
} else {
|
||||||
MemberModifier = "Sonstige Zu-/Abschläge";
|
MemberModifier = "Sonstige Zu-/Abschläge";
|
||||||
}
|
}
|
||||||
var total = data.Rows.SelectMany(r => r.Buckets).Sum(b => b.Value);
|
|
||||||
var totalUnderDelivery = total - p.Member.BusinessShares * season.MinKgPerBusinessShare;
|
|
||||||
MemberTotalUnderDelivery = totalUnderDelivery < 0 ? totalUnderDelivery * (season.PenaltyPerKg ?? 0) - (season.PenaltyAmount ?? 0) : 0;
|
|
||||||
var fromDate = $"{season.Year}-06-01";
|
|
||||||
var toDate = $"{season.Year + 1}-06-01";
|
|
||||||
MemberAutoBusinessShares = ctx.MemberHistory
|
|
||||||
.Where(h => h.MgNr == p.Member.MgNr && h.Type == "auto")
|
|
||||||
.Where(h => h.DateString.CompareTo(fromDate) >= 0 && h.DateString.CompareTo(toDate) < 0)
|
|
||||||
.Sum(h => h.BusinessShares) * (-season.BusinessShareValue ?? 0);
|
|
||||||
if (total == 0) MemberTotalUnderDelivery -= (season.PenaltyNone ?? 0);
|
|
||||||
Aside = Aside.Replace("</table>", "") +
|
Aside = Aside.Replace("</table>", "") +
|
||||||
$"<thead><tr><th colspan='2'>Gutschrift</th></tr></thead><tbody>" +
|
$"<thead><tr><th colspan='2'>Gutschrift</th></tr></thead><tbody>" +
|
||||||
$"<tr><th>TG-Nr.</th><td>{(p.Credit != null ? $"{p.Credit.Year}/{p.Credit.TgNr:000}" : "-")}</td></tr>" +
|
$"<tr><th>TG-Nr.</th><td>{(p.Credit != null ? $"{p.Credit.Year}/{p.Credit.TgNr:000}" : "-")}</td></tr>" +
|
||||||
$"<tr><th>Überw. am</th><td>{p.Variant.TransferDate:dd.MM.yyyy}</td></tr>" +
|
$"<tr><th>Überw. am</th><td>{p.Variant.TransferDate:dd.MM.yyyy}</td></tr>" +
|
||||||
$"<tr><th>Datum/Zeit</th><td>{p.Credit?.ModifiedTimestamp:dd.MM.yyyy} / {p.Credit?.ModifiedTimestamp:HH:mm}</td></tr>" +
|
$"<tr><th>Datum/Zeit</th><td>{p.Credit?.ModifiedTimestamp:dd.MM.yyyy} / {p.Credit?.ModifiedTimestamp:HH:mm}</td></tr>" +
|
||||||
$"</tbody></table>";
|
$"</tbody></table>";
|
||||||
Text = App.Client.TextDeliveryNote;
|
Text = App.Client.TextCreditNote;
|
||||||
DocumentId = $"Tr.-Gutschr. " + (p.Credit != null ? $"{p.Credit.Year}/{p.Credit.TgNr:000}" : p.MgNr);
|
DocumentId = $"Tr.-Gutschr. " + (p.Credit != null ? $"{p.Credit.Year}/{p.Credit.TgNr:000}" : p.MgNr);
|
||||||
CurrencySymbol = season.Currency.Symbol ?? season.Currency.Code;
|
CurrencySymbol = season.Currency.Symbol ?? season.Currency.Code;
|
||||||
Precision = season.Precision;
|
Precision = season.Precision;
|
||||||
|
|
||||||
var variants = ctx.WineVarieties.ToDictionary(v => v.SortId, v => v);
|
if (considerTotalPenalty) {
|
||||||
var attributes = ctx.WineAttributes.ToDictionary(a => a.AttrId, a => a);
|
var total = data.Rows.SelectMany(r => r.Buckets).Sum(b => b.Value);
|
||||||
var comTypes = ctx.AreaCommitmentTypes.ToDictionary(t => t.VtrgId, t => t);
|
var totalUnderDelivery = total - p.Member.BusinessShares * season.MinKgPerBusinessShare;
|
||||||
MemberUnderDeliveries = underDeliveries?
|
MemberTotalUnderDelivery = totalUnderDelivery < 0 ? totalUnderDelivery * (season.PenaltyPerKg ?? 0) - (season.PenaltyAmount ?? 0) : 0;
|
||||||
.OrderBy(u => u.Key)
|
if (total == 0)
|
||||||
.Select(u => (
|
MemberTotalUnderDelivery -= (season.PenaltyNone ?? 0);
|
||||||
variants[u.Key[..2]].Name + (u.Key.Length > 2 ? " " + attributes[u.Key[2..]].Name : ""),
|
}
|
||||||
u.Value.Diff,
|
if (considerAutoBusinessShares) {
|
||||||
u.Value.Diff * (comTypes[u.Key].PenaltyPerKg ?? 0)
|
var fromDate = $"{season.Year}-01-01";
|
||||||
- (comTypes[u.Key].PenaltyAmount ?? 0)
|
var toDate = $"{season.Year}-12-31";
|
||||||
- ((u.Value.Weight == 0 ? comTypes[u.Key].PenaltyNone : null) ?? 0)))
|
MemberAutoBusinessShares = ctx.MemberHistory
|
||||||
.Where(u => u.Item3 != 0)
|
.Where(h => h.MgNr == p.Member.MgNr && h.Type == "auto")
|
||||||
.ToList();
|
.Where(h => h.DateString.CompareTo(fromDate) >= 0 && h.DateString.CompareTo(toDate) <= 0)
|
||||||
|
.Sum(h => h.BusinessShares) * (-season.BusinessShareValue ?? 0);
|
||||||
|
}
|
||||||
|
if (considerContractPenalties) {
|
||||||
|
var varieties = ctx.WineVarieties.ToDictionary(v => v.SortId, v => v);
|
||||||
|
var attributes = ctx.WineAttributes.ToDictionary(a => a.AttrId, a => a);
|
||||||
|
var comTypes = ctx.AreaCommitmentTypes.ToDictionary(t => t.VtrgId, t => t);
|
||||||
|
MemberUnderDeliveries = underDeliveries?
|
||||||
|
.OrderBy(u => u.Key)
|
||||||
|
.Select(u => (
|
||||||
|
varieties[u.Key[..2]].Name + (u.Key.Length > 2 ? " " + attributes[u.Key[2..]].Name : ""),
|
||||||
|
u.Value.Diff,
|
||||||
|
u.Value.Diff * (comTypes[u.Key].PenaltyPerKg ?? 0)
|
||||||
|
- (comTypes[u.Key].PenaltyAmount ?? 0)
|
||||||
|
- ((u.Value.Weight == 0 ? comTypes[u.Key].PenaltyNone : null) ?? 0)))
|
||||||
|
.Where(u => u.Item3 != 0)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
@if (i == 0) {
|
@if (i == 0) {
|
||||||
<td rowspan="@rows">@p.LsNr</td>
|
<td rowspan="@rows">@p.LsNr</td>
|
||||||
<td rowspan="@rows">@p.DPNr</td>
|
<td rowspan="@rows">@p.DPNr</td>
|
||||||
<td class="small">@p.Variant</td>
|
<td class="small">@p.Variety</td>
|
||||||
<td class="small">@p.Attribute</td>
|
<td class="small">@p.Attribute</td>
|
||||||
<td rowspan="@rows" class="center">@($"{p.Gradation.Oe:N0}")</td>
|
<td rowspan="@rows" class="center">@($"{p.Gradation.Oe:N0}")</td>
|
||||||
<td rowspan="@rows" class="center">@($"{p.Gradation.Kmw:N1}")</td>
|
<td rowspan="@rows" class="center">@($"{p.Gradation.Kmw:N1}")</td>
|
||||||
@@ -81,15 +81,20 @@
|
|||||||
</table>
|
</table>
|
||||||
<div class="hint">
|
<div class="hint">
|
||||||
Hinweis:<br/>
|
Hinweis:<br/>
|
||||||
Die Summe der Lieferungen und die Summe der anfallenden Pönalen werden mit
|
Die Summe der Lieferungen und die Summe der anfal­lenden Pönalen werden mit
|
||||||
@Model.Payment?.Variant.Season.Precision Nachkommastellen berechnent,
|
@Model.Payment?.Variant.Season.Precision Nach­komma­stellen berechnent,
|
||||||
erst das Ergebnis wird kaufmännisch auf 2 Nachkommastellen gerundet.
|
erst das Ergebnis wird kauf­männisch auf 2 Nach­komma­stellen gerundet.
|
||||||
</div>
|
</div>
|
||||||
<table class="credit-sum">
|
<table class="credit-sum">
|
||||||
|
<colgroup>
|
||||||
|
<col style="width: auto;"/>
|
||||||
|
<col style="width: 5mm;"/>
|
||||||
|
<col style="width: 30mm;"/>
|
||||||
|
</colgroup>
|
||||||
@{
|
@{
|
||||||
string FormatRow(string name, decimal? value, bool add = false, bool bold = false, bool subCat = false, bool noTopBorder = false) {
|
string FormatRow(string name, decimal? value, bool add = false, bool bold = false, bool subCat = false, bool noTopBorder = false) {
|
||||||
return $"<tr class=\"{(!add && !noTopBorder ? "sum" : !add ? "large" : "")} {(bold ? "large bold" : "")}\">"
|
return $"<tr class=\"{(!add && !noTopBorder ? "sum" : !add ? "large" : "")} {(bold ? "large bold" : "")}\">"
|
||||||
+ $"<td class=\"{(subCat ? "small" : "")}\" style=\"overflow: visible;\">{name}:</td>"
|
+ $"<td class=\"{(subCat ? "small" : "")}\">{name}:</td>"
|
||||||
+ $"<td class=\"number {(subCat ? "small" : "large")}\">{(value < 0 ? "–" : (add ? "+" : ""))}</td>"
|
+ $"<td class=\"number {(subCat ? "small" : "large")}\">{(value < 0 ? "–" : (add ? "+" : ""))}</td>"
|
||||||
+ $"<td class=\"number {(subCat ? "small" : "large")}\">"
|
+ $"<td class=\"number {(subCat ? "small" : "large")}\">"
|
||||||
+ $"<span class=\"fleft\">{Model.CurrencySymbol}</span>{Math.Abs(value ?? 0):N2}</td>"
|
+ $"<span class=\"fleft\">{Model.CurrencySymbol}</span>{Math.Abs(value ?? 0):N2}</td>"
|
||||||
@@ -148,8 +153,9 @@
|
|||||||
@if (Model.Credit == null) {
|
@if (Model.Credit == null) {
|
||||||
@Raw(FormatRow("Auszahlungsbetrag", (Model.Payment?.Amount + penalty) ?? (sum + penalty), bold: true))
|
@Raw(FormatRow("Auszahlungsbetrag", (Model.Payment?.Amount + penalty) ?? (sum + penalty), bold: true))
|
||||||
} else {
|
} else {
|
||||||
if (Model.Credit.Modifiers - penalty != 0) {
|
var diff = Model.Credit.Modifiers - penalty;
|
||||||
@Raw(FormatRow("Weitere Abzüge", Model.Credit.Modifiers - penalty, add: true))
|
if (diff != 0) {
|
||||||
|
@Raw(FormatRow(diff < 0 ? "Weitere Abzüge" : "Weitere Zuschläge", diff, add: true))
|
||||||
}
|
}
|
||||||
if (Model.Credit.PrevModifiers != null && Model.Credit.PrevModifiers != 0) {
|
if (Model.Credit.PrevModifiers != null && Model.Credit.PrevModifiers != 0) {
|
||||||
@Raw(FormatRow("Bereits berücksichtigte Abzüge", -Model.Credit.PrevModifiers, add: true))
|
@Raw(FormatRow("Bereits berücksichtigte Abzüge", -Model.Credit.PrevModifiers, add: true))
|
||||||
@@ -158,4 +164,10 @@
|
|||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<p>Überweisung erfolgt auf Konto @(Elwig.Helpers.Utils.FormatIban(Model.Member.Iban ?? "-")).</p>
|
||||||
|
<div style="margin-top: 1em;">
|
||||||
|
@if (Model.Text != null) {
|
||||||
|
<p class="custom">@Model.Text</p>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -24,8 +24,8 @@ table.credit tr.last td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
table.credit-sum {
|
table.credit-sum {
|
||||||
width: 50%;
|
width: 60%;
|
||||||
margin-left: 50%;
|
margin-left: 40%;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.credit-sum tr.sum,
|
table.credit-sum tr.sum,
|
||||||
@@ -41,7 +41,7 @@ table.credit-sum td.sum {
|
|||||||
.hint {
|
.hint {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
font-size: 8pt;
|
font-size: 8pt;
|
||||||
width: 74mm;
|
width: 56mm;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
margin: 2mm 4mm;
|
margin: 2mm 4mm;
|
||||||
|
|||||||
@@ -10,11 +10,11 @@ namespace Elwig.Documents {
|
|||||||
public new static string Name => "Anlieferungsbestätigung";
|
public new static string Name => "Anlieferungsbestätigung";
|
||||||
|
|
||||||
public Season Season;
|
public Season Season;
|
||||||
public DeliveryConfirmationData Data;
|
public DeliveryConfirmationDeliveryData Data;
|
||||||
public string? Text = App.Client.TextDeliveryConfirmation;
|
public string? Text = App.Client.TextDeliveryConfirmation;
|
||||||
public Dictionary<string, MemberBucket> MemberBuckets;
|
public Dictionary<string, MemberBucket> MemberBuckets;
|
||||||
|
|
||||||
public DeliveryConfirmation(AppDbContext ctx, int year, Member m, DeliveryConfirmationData data) :
|
public DeliveryConfirmation(AppDbContext ctx, int year, Member m, DeliveryConfirmationDeliveryData data) :
|
||||||
base($"{Name} {year}", m) {
|
base($"{Name} {year}", m) {
|
||||||
Season = ctx.Seasons.Find(year) ?? throw new ArgumentException("invalid season");
|
Season = ctx.Seasons.Find(year) ?? throw new ArgumentException("invalid season");
|
||||||
ShowDateAndLocation = true;
|
ShowDateAndLocation = true;
|
||||||
|
|||||||
@@ -42,17 +42,17 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@{
|
@{
|
||||||
var lastVariant = "";
|
var lastVariety = "";
|
||||||
}
|
}
|
||||||
@foreach (var p in Model.Data.Rows) {
|
@foreach (var p in Model.Data.Rows) {
|
||||||
var rows = Math.Max(p.Buckets.Length, p.Modifiers.Length + 1);
|
var rows = Math.Max(p.Buckets.Length, p.Modifiers.Length + 1);
|
||||||
var first = true;
|
var first = true;
|
||||||
@for (int i = 0; i < rows; i++) {
|
@for (int i = 0; i < rows; i++) {
|
||||||
<tr class="@(first ? "first" : "") @(p.Variant != lastVariant && lastVariant != "" ? "new": "") @(rows > i + 1 ? "last" : "")">
|
<tr class="@(first ? "first" : "") @(p.Variety != lastVariety && lastVariety != "" ? "new": "") @(rows > i + 1 ? "last" : "")">
|
||||||
@if (first) {
|
@if (first) {
|
||||||
<td rowspan="@rows">@p.LsNr</td>
|
<td rowspan="@rows">@p.LsNr</td>
|
||||||
<td rowspan="@rows">@p.DPNr</td>
|
<td rowspan="@rows">@p.DPNr</td>
|
||||||
<td class="small">@p.Variant</td>
|
<td class="small">@p.Variety</td>
|
||||||
<td class="small">@p.Attribute</td>
|
<td class="small">@p.Attribute</td>
|
||||||
<td class="small">@p.QualityLevel</td>
|
<td class="small">@p.QualityLevel</td>
|
||||||
<td rowspan="@rows" class="center">@($"{p.Gradation.Oe:N0}")</td>
|
<td rowspan="@rows" class="center">@($"{p.Gradation.Oe:N0}")</td>
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
</tr>
|
</tr>
|
||||||
lastVariant = p.Variant;
|
lastVariety = p.Variety;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<tr class="sum bold">
|
<tr class="sum bold">
|
||||||
@@ -92,9 +92,9 @@
|
|||||||
</table>
|
</table>
|
||||||
@Raw(BusinessDocument.PrintSortenaufteilung(Model.MemberBuckets))
|
@Raw(BusinessDocument.PrintSortenaufteilung(Model.MemberBuckets))
|
||||||
@Raw(Model.PrintBucketTable(Model.Season, Model.MemberBuckets, includePayment: true))
|
@Raw(Model.PrintBucketTable(Model.Season, Model.MemberBuckets, includePayment: true))
|
||||||
<div class="text" style="margin-top: 2em;">
|
<div style="margin-top: 2em;">
|
||||||
@if (Model.Text != null) {
|
@if (Model.Text != null) {
|
||||||
<p class="comment" style="white-space: pre-wrap; break-inside: avoid;">@Model.Text</p>
|
<p class="custom comment">@Model.Text</p>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Elwig.Documents {
|
|||||||
public DeliveryJournal(string filter, IQueryable<DeliveryPart> deliveries) :
|
public DeliveryJournal(string filter, IQueryable<DeliveryPart> deliveries) :
|
||||||
this(filter, deliveries
|
this(filter, deliveries
|
||||||
.Include(p => p.Delivery).ThenInclude(d => d.Member)
|
.Include(p => p.Delivery).ThenInclude(d => d.Member)
|
||||||
.Include(p => p.Variant)
|
.Include(p => p.Variety)
|
||||||
.ToList()) { }
|
.ToList()) { }
|
||||||
|
|
||||||
public DeliveryJournal(AppDbContext ctx, DateOnly date) :
|
public DeliveryJournal(AppDbContext ctx, DateOnly date) :
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<td class="small">@($"{p.Delivery.Time:HH:mm}")</td>
|
<td class="small">@($"{p.Delivery.Time:HH:mm}")</td>
|
||||||
<td class="number">@p.Delivery.Member.MgNr</td>
|
<td class="number">@p.Delivery.Member.MgNr</td>
|
||||||
<td class="small">@p.Delivery.Member.AdministrativeName</td>
|
<td class="small">@p.Delivery.Member.AdministrativeName</td>
|
||||||
<td class="small">@p.Variant.Name</td>
|
<td class="small">@p.Variety.Name</td>
|
||||||
<td class="center">@($"{p.Oe:N0}")</td>
|
<td class="center">@($"{p.Oe:N0}")</td>
|
||||||
<td class="center">@($"{p.Kmw:N1}")</td>
|
<td class="center">@($"{p.Kmw:N1}")</td>
|
||||||
<td class="number">@($"{p.Weight:N0}")</td>
|
<td class="number">@($"{p.Weight:N0}")</td>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
@foreach (var part in Model.Delivery.Parts.OrderBy(p => p.DPNr)) {
|
@foreach (var part in Model.Delivery.Parts.OrderBy(p => p.DPNr)) {
|
||||||
<tr class="main">
|
<tr class="main">
|
||||||
<td class="center">@part.DPNr</td>
|
<td class="center">@part.DPNr</td>
|
||||||
<td colspan="2">@part.Variant.Name</td>
|
<td colspan="2">@part.Variety.Name</td>
|
||||||
<td colspan="2">@part.Attribute?.Name</td>
|
<td colspan="2">@part.Attribute?.Name</td>
|
||||||
<td>@part.Quality.Name</td>
|
<td>@part.Quality.Name</td>
|
||||||
<td class="center">@($"{part.Oe:N0}")</td>
|
<td class="center">@($"{part.Oe:N0}")</td>
|
||||||
|
|||||||
+2
-2
@@ -7,7 +7,7 @@
|
|||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<PreserveCompilationContext>true</PreserveCompilationContext>
|
<PreserveCompilationContext>true</PreserveCompilationContext>
|
||||||
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
|
<ApplicationIcon>Resources\Images\Elwig.ico</ApplicationIcon>
|
||||||
<Version>0.6.0</Version>
|
<Version>0.6.4</Version>
|
||||||
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
|
<SatelliteResourceLanguages>de-AT</SatelliteResourceLanguages>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2210.55" />
|
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2210.55" />
|
||||||
<PackageReference Include="NJsonSchema" Version="11.0.0" />
|
<PackageReference Include="NJsonSchema" Version="11.0.0" />
|
||||||
<PackageReference Include="RazorLight" Version="2.3.1" />
|
<PackageReference Include="RazorLight" Version="2.3.1" />
|
||||||
<PackageReference Include="ScottPlot.WPF" Version="4.1.68" />
|
<PackageReference Include="ScottPlot.WPF" Version="5.0.19" />
|
||||||
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
|
<PackageReference Include="System.IO.Ports" Version="8.0.0" />
|
||||||
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
|
<PackageReference Include="System.Text.Encoding.CodePages" Version="8.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ namespace Elwig.Helpers {
|
|||||||
public DbSet<OverUnderDeliveryRow> OverUnderDeliveryRows { get; private set; }
|
public DbSet<OverUnderDeliveryRow> OverUnderDeliveryRows { get; private set; }
|
||||||
public DbSet<AreaComUnderDeliveryRowSingle> AreaComUnderDeliveryRows { get; private set; }
|
public DbSet<AreaComUnderDeliveryRowSingle> AreaComUnderDeliveryRows { get; private set; }
|
||||||
public DbSet<MemberDeliveryPerVariantRowSingle> MemberDeliveryPerVariantRows { get; private set; }
|
public DbSet<MemberDeliveryPerVariantRowSingle> MemberDeliveryPerVariantRows { get; private set; }
|
||||||
|
public DbSet<CreditNoteDeliveryRowSingle> CreditNoteDeliveryRows { get; private set; }
|
||||||
public DbSet<CreditNoteRowSingle> CreditNoteRows { get; private set; }
|
public DbSet<CreditNoteRowSingle> CreditNoteRows { get; private set; }
|
||||||
|
|
||||||
private readonly StreamWriter? LogFile = null;
|
private readonly StreamWriter? LogFile = null;
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace Elwig.Helpers {
|
|||||||
public static class AppDbUpdater {
|
public static class AppDbUpdater {
|
||||||
|
|
||||||
// Don't forget to update value in Tests/fetch-resources.bat!
|
// Don't forget to update value in Tests/fetch-resources.bat!
|
||||||
public static readonly int RequiredSchemaVersion = 13;
|
public static readonly int RequiredSchemaVersion = 15;
|
||||||
|
|
||||||
private static int VersionOffset = 0;
|
private static int VersionOffset = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
using Elwig.Models.Entities;
|
||||||
|
using Microsoft.Data.Sqlite;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -8,6 +10,7 @@ namespace Elwig.Helpers.Billing {
|
|||||||
|
|
||||||
protected readonly int Year;
|
protected readonly int Year;
|
||||||
protected readonly AppDbContext Context;
|
protected readonly AppDbContext Context;
|
||||||
|
protected readonly Season Season;
|
||||||
protected readonly Dictionary<string, string> Attributes;
|
protected readonly Dictionary<string, string> Attributes;
|
||||||
protected readonly Dictionary<string, (decimal?, decimal?)> Modifiers;
|
protected readonly Dictionary<string, (decimal?, decimal?)> Modifiers;
|
||||||
protected readonly Dictionary<string, (string, string?, string?, int?, decimal?)> AreaComTypes;
|
protected readonly Dictionary<string, (string, string?, string?, int?, decimal?)> AreaComTypes;
|
||||||
@@ -15,6 +18,7 @@ namespace Elwig.Helpers.Billing {
|
|||||||
public Billing(int year) {
|
public Billing(int year) {
|
||||||
Year = year;
|
Year = year;
|
||||||
Context = new AppDbContext();
|
Context = new AppDbContext();
|
||||||
|
Season = Context.Seasons.Find(Year)!;
|
||||||
Attributes = Context.WineAttributes.ToDictionary(a => a.AttrId, a => a.Name);
|
Attributes = Context.WineAttributes.ToDictionary(a => a.AttrId, a => a.Name);
|
||||||
Modifiers = Context.Modifiers.Where(m => m.Year == Year).ToDictionary(m => m.ModId, m => (m.Abs, m.Rel));
|
Modifiers = Context.Modifiers.Where(m => m.Year == Year).ToDictionary(m => m.ModId, m => (m.Abs, m.Rel));
|
||||||
AreaComTypes = Context.AreaCommitmentTypes.ToDictionary(v => v.VtrgId, v => (v.SortId, v.AttrId, v.Discriminator, v.MinKgPerHa, v.PenaltyAmount));
|
AreaComTypes = Context.AreaCommitmentTypes.ToDictionary(v => v.VtrgId, v => (v.SortId, v.AttrId, v.Discriminator, v.MinKgPerHa, v.PenaltyAmount));
|
||||||
@@ -26,8 +30,6 @@ namespace Elwig.Helpers.Billing {
|
|||||||
UPDATE season
|
UPDATE season
|
||||||
SET (start_date, end_date) = (SELECT MIN(date), MAX(date) FROM delivery WHERE year = {Year})
|
SET (start_date, end_date) = (SELECT MIN(date), MAX(date) FROM delivery WHERE year = {Year})
|
||||||
WHERE year = {Year};
|
WHERE year = {Year};
|
||||||
|
|
||||||
DELETE FROM delivery_part_bucket WHERE year = {Year};
|
|
||||||
""");
|
""");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,10 +45,19 @@ namespace Elwig.Helpers.Billing {
|
|||||||
""");
|
""");
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task CalculateBuckets(bool allowAttrsIntoLower, bool avoidUnderDeliveries, bool honorGebunden) {
|
public async Task CalculateBuckets(
|
||||||
|
bool? honorGebundenField = null,
|
||||||
|
bool? allowAttributesIntoLower = null,
|
||||||
|
bool? avoidUnderDeliveries = null,
|
||||||
|
SqliteConnection? cnx = null
|
||||||
|
) {
|
||||||
|
var honorGebunden = honorGebundenField ?? Season.Billing_HonorGebunden;
|
||||||
|
var allowAttrsIntoLower = allowAttributesIntoLower ?? Season.Billing_AllowAttrsIntoLower;
|
||||||
|
var avoidUnderDlvrs = avoidUnderDeliveries ?? Season.Billing_AvoidUnderDeliveries;
|
||||||
var attrVals = Context.WineAttributes.ToDictionary(a => a.AttrId, a => (a.IsStrict, a.FillLower));
|
var attrVals = Context.WineAttributes.ToDictionary(a => a.AttrId, a => (a.IsStrict, a.FillLower));
|
||||||
var attrForced = attrVals.Where(a => a.Value.IsStrict && a.Value.FillLower == 0).Select(a => a.Key).ToArray();
|
var attrForced = attrVals.Where(a => a.Value.IsStrict && a.Value.FillLower == 0).Select(a => a.Key).ToArray();
|
||||||
using var cnx = await AppDbContext.ConnectAsync();
|
var ownCnx = cnx == null;
|
||||||
|
cnx ??= await AppDbContext.ConnectAsync();
|
||||||
await Context.GetMemberAreaCommitmentBuckets(Year, 0, cnx);
|
await Context.GetMemberAreaCommitmentBuckets(Year, 0, cnx);
|
||||||
var inserts = new List<(int, int, int, string, int)>();
|
var inserts = new List<(int, int, int, string, int)>();
|
||||||
|
|
||||||
@@ -65,7 +76,7 @@ namespace Elwig.Helpers.Billing {
|
|||||||
reader.GetInt32(0), reader.GetInt32(1), reader.GetInt32(2), reader.GetString(3), reader.GetInt32(4),
|
reader.GetInt32(0), reader.GetInt32(1), reader.GetInt32(2), reader.GetString(3), reader.GetInt32(4),
|
||||||
reader.GetDouble(5), reader.GetString(6),
|
reader.GetDouble(5), reader.GetString(6),
|
||||||
reader.IsDBNull(7) ? null : reader.GetString(7),
|
reader.IsDBNull(7) ? null : reader.GetString(7),
|
||||||
reader.IsDBNull(8) ? Array.Empty<string>() : reader.GetString(8).Split(",").Order().ToArray(),
|
reader.IsDBNull(8) ? [] : reader.GetString(8).Split(",").Order().ToArray(),
|
||||||
reader.IsDBNull(9) ? null : reader.GetBoolean(9)
|
reader.IsDBNull(9) ? null : reader.GetBoolean(9)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -73,11 +84,11 @@ namespace Elwig.Helpers.Billing {
|
|||||||
|
|
||||||
int lastMgNr = 0;
|
int lastMgNr = 0;
|
||||||
Dictionary<string, AreaComBucket>? rightsAndObligations = null;
|
Dictionary<string, AreaComBucket>? rightsAndObligations = null;
|
||||||
Dictionary<string, int> used = new();
|
Dictionary<string, int> used = [];
|
||||||
foreach (var (mgnr, did, dpnr, sortid, weight, kmw, qualid, attrid, modifiers, gebunden) in deliveries) {
|
foreach (var (mgnr, did, dpnr, sortid, weight, kmw, qualid, attrid, modifiers, gebunden) in deliveries) {
|
||||||
if (lastMgNr != mgnr) {
|
if (lastMgNr != mgnr) {
|
||||||
rightsAndObligations = await Context.GetMemberAreaCommitmentBuckets(Year, mgnr);
|
rightsAndObligations = await Context.GetMemberAreaCommitmentBuckets(Year, mgnr);
|
||||||
used = new();
|
used = [];
|
||||||
}
|
}
|
||||||
if ((honorGebunden && gebunden == false) ||
|
if ((honorGebunden && gebunden == false) ||
|
||||||
rightsAndObligations == null || rightsAndObligations.Count == 0 ||
|
rightsAndObligations == null || rightsAndObligations.Count == 0 ||
|
||||||
@@ -92,16 +103,16 @@ namespace Elwig.Helpers.Billing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int w = weight;
|
int w = weight;
|
||||||
var attributes = attrid == null ? Array.Empty<string>() : new string[] { attrid };
|
var attributes = attrid == null ? [] : new string[] { attrid };
|
||||||
var isStrict = attrid != null && attrVals[attrid].IsStrict;
|
var isStrict = attrid != null && attrVals[attrid].IsStrict;
|
||||||
foreach (var p in Utils.Permutate(attributes, attributes.Intersect(attrForced))) {
|
foreach (var p in Utils.Permutate(attributes, attributes.Intersect(attrForced))) {
|
||||||
var c = p.Count();
|
var c = p.Count();
|
||||||
var key = sortid + string.Join("", p);
|
var key = sortid + string.Join("", p);
|
||||||
if (rightsAndObligations.ContainsKey(key)) {
|
if (rightsAndObligations.TryGetValue(key, out AreaComBucket value)) {
|
||||||
int i = (c == 0) ? 1 : 2;
|
int i = (c == 0) ? 1 : 2;
|
||||||
var u = used.GetValueOrDefault(key, 0);
|
var u = used.GetValueOrDefault(key, 0);
|
||||||
var vr = Math.Max(0, Math.Min(rightsAndObligations[key].Right - u, w));
|
var vr = Math.Max(0, Math.Min(value.Right - u, w));
|
||||||
var vo = Math.Max(0, Math.Min(rightsAndObligations[key].Obligation - u, w));
|
var vo = Math.Max(0, Math.Min(value.Obligation - u, w));
|
||||||
var v = (attributes.Length == c || attributes.Select(a => !attrVals[a].IsStrict ? 2 : attrVals[a].FillLower).Min() == 2) ? vr : vo;
|
var v = (attributes.Length == c || attributes.Select(a => !attrVals[a].IsStrict ? 2 : attrVals[a].FillLower).Min() == 2) ? vr : vo;
|
||||||
used[key] = u + v;
|
used[key] = u + v;
|
||||||
if (key.Length > 2 && !isStrict) used[key[..2]] = used.GetValueOrDefault(key[..2], 0) + v;
|
if (key.Length > 2 && !isStrict) used[key[..2]] = used.GetValueOrDefault(key[..2], 0) + v;
|
||||||
@@ -115,14 +126,17 @@ namespace Elwig.Helpers.Billing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await AppDbContext.ExecuteBatch(cnx, $"""
|
await AppDbContext.ExecuteBatch(cnx, $"""
|
||||||
|
UPDATE delivery_part_bucket SET value = 0 WHERE year = {Year};
|
||||||
INSERT INTO delivery_part_bucket (year, did, dpnr, bktnr, discr, value)
|
INSERT INTO delivery_part_bucket (year, did, dpnr, bktnr, discr, value)
|
||||||
VALUES {string.Join(",\n ", inserts.Select(i => $"({Year}, {i.Item1}, {i.Item2}, {i.Item3}, '{i.Item4}', {i.Item5})"))}
|
VALUES {string.Join(",\n ", inserts.Select(i => $"({Year}, {i.Item1}, {i.Item2}, {i.Item3}, '{i.Item4}', {i.Item5})"))}
|
||||||
ON CONFLICT DO UPDATE
|
ON CONFLICT DO UPDATE
|
||||||
SET discr = excluded.discr, value = value + excluded.value;
|
SET discr = excluded.discr, value = value + excluded.value;
|
||||||
""");
|
""");
|
||||||
|
|
||||||
if (!avoidUnderDeliveries)
|
if (!avoidUnderDlvrs) {
|
||||||
|
if (ownCnx) await cnx.DisposeAsync();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME avoidUnderDelivery-calculations not always right!
|
// FIXME avoidUnderDelivery-calculations not always right!
|
||||||
|
|
||||||
@@ -200,6 +214,8 @@ namespace Elwig.Helpers.Billing {
|
|||||||
ON CONFLICT DO UPDATE
|
ON CONFLICT DO UPDATE
|
||||||
SET value = excluded.value;
|
SET value = excluded.value;
|
||||||
""");
|
""");
|
||||||
|
|
||||||
|
if (ownCnx) await cnx.DisposeAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ namespace Elwig.Helpers.Billing {
|
|||||||
var obj = c?.AsObject() ?? throw new InvalidOperationException();
|
var obj = c?.AsObject() ?? throw new InvalidOperationException();
|
||||||
var id = obj["id"]?.GetValue<int>() ?? throw new InvalidOperationException();
|
var id = obj["id"]?.GetValue<int>() ?? throw new InvalidOperationException();
|
||||||
var cMode = (obj["mode"]?.GetValue<string>() == "kmw") ? CurveMode.Kmw : CurveMode.Oe;
|
var cMode = (obj["mode"]?.GetValue<string>() == "kmw") ? CurveMode.Kmw : CurveMode.Oe;
|
||||||
|
double quw = cMode == CurveMode.Oe ? 73 : 15;
|
||||||
|
|
||||||
Dictionary<double, decimal> c1;
|
Dictionary<double, decimal> c1;
|
||||||
Dictionary<double, decimal>? c2 = null;
|
Dictionary<double, decimal>? c2 = null;
|
||||||
@@ -131,7 +132,7 @@ namespace Elwig.Helpers.Billing {
|
|||||||
if (norm is JsonObject) {
|
if (norm is JsonObject) {
|
||||||
c1 = GetCurveData(norm.AsObject(), cMode);
|
c1 = GetCurveData(norm.AsObject(), cMode);
|
||||||
} else if (norm?.AsValue().TryGetValue(out decimal v) == true) {
|
} else if (norm?.AsValue().TryGetValue(out decimal v) == true) {
|
||||||
c1 = new() { { cMode == CurveMode.Oe ? 73 : 15, v } };
|
c1 = new() { { quw, v } };
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidOperationException();
|
throw new InvalidOperationException();
|
||||||
}
|
}
|
||||||
@@ -139,11 +140,248 @@ namespace Elwig.Helpers.Billing {
|
|||||||
if (geb is JsonObject) {
|
if (geb is JsonObject) {
|
||||||
c2 = GetCurveData(geb.AsObject(), cMode);
|
c2 = GetCurveData(geb.AsObject(), cMode);
|
||||||
} else if (geb?.AsValue().TryGetValue(out decimal v) == true) {
|
} else if (geb?.AsValue().TryGetValue(out decimal v) == true) {
|
||||||
c2 = c1.ToDictionary(e => e.Key, e => e.Value + v);
|
var splitVal = GetCurveValueAt(c1, quw);
|
||||||
|
c2 = c1.ToDictionary(e => e.Key, e => e.Value + (e.Key >= quw ? v : 0));
|
||||||
|
c2[quw] = splitVal + v;
|
||||||
|
c2[Math.BitDecrement(quw)] = splitVal;
|
||||||
}
|
}
|
||||||
dict.Add(id, new(cMode, c1, c2));
|
dict.Add(id, new(cMode, c1, c2));
|
||||||
}
|
}
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static Dictionary<string, JsonValue> GetSelection(JsonNode value, IEnumerable<string> vaributes) {
|
||||||
|
if (value is JsonValue flatRate) {
|
||||||
|
return vaributes.ToDictionary(e => e, _ => flatRate);
|
||||||
|
} if (value is not JsonObject data) {
|
||||||
|
throw new InvalidOperationException();
|
||||||
|
}
|
||||||
|
Dictionary<string, JsonValue> dict;
|
||||||
|
if (data["default"] is JsonValue def) {
|
||||||
|
dict = vaributes.ToDictionary(e => e, _ => def);
|
||||||
|
} else {
|
||||||
|
dict = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
var varieties = data.Where(p => !p.Key.StartsWith('/') && p.Key.Length == 2);
|
||||||
|
var attributes = data.Where(p => p.Key.StartsWith('/'));
|
||||||
|
var others = data.Where(p => !p.Key.StartsWith('/') && p.Key.Length > 2 && p.Key != "default");
|
||||||
|
foreach (var (idx, v) in varieties) {
|
||||||
|
var curve = v?.AsValue() ?? throw new InvalidOperationException();
|
||||||
|
foreach (var i in vaributes.Where(e => e.StartsWith(idx[..^1]))) {
|
||||||
|
dict[i] = curve;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (var (idx, v) in attributes) {
|
||||||
|
var curve = v?.AsValue() ?? throw new InvalidOperationException();
|
||||||
|
foreach (var i in vaributes.Where(e => e[2..] == idx[1..])) {
|
||||||
|
dict[i] = curve;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (var (idx, v) in others) {
|
||||||
|
var curve = v?.AsValue() ?? throw new InvalidOperationException();
|
||||||
|
dict[idx.Replace("/", "")] = curve;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dict;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static decimal GetCurveValueAt(Dictionary<double, decimal> curve, double key) {
|
||||||
|
if (curve.Count == 1) return curve.First().Value;
|
||||||
|
|
||||||
|
var lt = curve.Keys.Where(v => v <= key);
|
||||||
|
var gt = curve.Keys.Where(v => v >= key);
|
||||||
|
if (!lt.Any()) {
|
||||||
|
return curve[gt.Min()];
|
||||||
|
} else if (!gt.Any()) {
|
||||||
|
return curve[lt.Max()];
|
||||||
|
}
|
||||||
|
|
||||||
|
var max = lt.Max();
|
||||||
|
var min = gt.Min();
|
||||||
|
if (max == min) return curve[key];
|
||||||
|
|
||||||
|
var p1 = ((decimal)key - (decimal)min) / ((decimal)max - (decimal)min);
|
||||||
|
var p2 = 1 - p1;
|
||||||
|
return curve[min] * p2 + curve[max] * p1;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static JsonObject GraphToJson(Graph graph, string mode) {
|
||||||
|
var x = graph.DataX;
|
||||||
|
var y = graph.DataY;
|
||||||
|
var prec = graph.Precision;
|
||||||
|
|
||||||
|
try {
|
||||||
|
return new JsonObject() {
|
||||||
|
["15kmw"] = Math.Round(y.Distinct().Single(), prec)
|
||||||
|
};
|
||||||
|
} catch { }
|
||||||
|
|
||||||
|
var data = new JsonObject();
|
||||||
|
if (y[0] != y[1]) {
|
||||||
|
data[$"{x[0]}{mode}"] = Math.Round(y[0], prec);
|
||||||
|
}
|
||||||
|
for (int i = 1; i < x.Length - 1; i++) {
|
||||||
|
var d1 = Math.Round(y[i] - y[i - 1], prec);
|
||||||
|
var d2 = Math.Round(y[i + 1] - y[i], prec);
|
||||||
|
if (d1 != d2) {
|
||||||
|
data[$"{x[i]}{mode}"] = Math.Round(y[i], prec);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (y[^1] != y[^2]) {
|
||||||
|
data[$"{x[^1]}{mode}"] = Math.Round(y[^1], prec);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static JsonNode GraphEntryToJson(GraphEntry entry) {
|
||||||
|
try {
|
||||||
|
if (entry.GebundenFlatBonus == null) {
|
||||||
|
return JsonValue.Create((decimal)entry.DataGraph.DataY.Distinct().Single());
|
||||||
|
}
|
||||||
|
} catch { }
|
||||||
|
|
||||||
|
var curve = new JsonObject {
|
||||||
|
["id"] = entry.Id,
|
||||||
|
["mode"] = entry.Mode.ToString().ToLower(),
|
||||||
|
};
|
||||||
|
|
||||||
|
curve["data"] = GraphToJson(entry.DataGraph, entry.Mode.ToString().ToLower());
|
||||||
|
|
||||||
|
if (entry.GebundenFlatBonus != null) {
|
||||||
|
curve["geb"] = (decimal)entry.GebundenFlatBonus;
|
||||||
|
} else if (entry.GebundenGraph != null) {
|
||||||
|
curve["geb"] = GraphToJson(entry.GebundenGraph, entry.Mode.ToString().ToLower());
|
||||||
|
}
|
||||||
|
|
||||||
|
return curve;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static void CollapsePaymentData(JsonObject data, IEnumerable<string> vaributes, bool useDefault = true) {
|
||||||
|
Dictionary<string, List<string>> rev1 = [];
|
||||||
|
Dictionary<decimal, List<string>> rev2 = [];
|
||||||
|
foreach (var (k, v) in data) {
|
||||||
|
if (k == "default" || k.StartsWith('/') || !k.Contains('/') || v is not JsonValue val) {
|
||||||
|
continue;
|
||||||
|
} else if (val.TryGetValue<decimal>(out var dec)) {
|
||||||
|
rev2[dec] = rev2.GetValueOrDefault(dec) ?? [];
|
||||||
|
rev2[dec].Add(k);
|
||||||
|
} else if (val.TryGetValue<string>(out var cur)) {
|
||||||
|
rev1[cur] = rev1.GetValueOrDefault(cur) ?? [];
|
||||||
|
rev1[cur].Add(k);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!data.ContainsKey("default")) {
|
||||||
|
foreach (var (v, ks) in rev1) {
|
||||||
|
if ((ks.Count >= vaributes.Count() * 0.5 && useDefault) || ks.Count == vaributes.Count()) {
|
||||||
|
foreach (var k in ks) data.Remove(k);
|
||||||
|
data["default"] = v;
|
||||||
|
CollapsePaymentData(data, vaributes, useDefault);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (var (v, ks) in rev2) {
|
||||||
|
if ((ks.Count >= vaributes.Count() * 0.5 && useDefault) || ks.Count == vaributes.Count()) {
|
||||||
|
foreach (var k in ks) data.Remove(k);
|
||||||
|
data["default"] = v;
|
||||||
|
CollapsePaymentData(data, vaributes, useDefault);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var attributes = data
|
||||||
|
.Select(e => e.Key)
|
||||||
|
.Where(k => k.Length > 3 && k.Contains('/'))
|
||||||
|
.Select(k => "/" + k.Split('/')[1])
|
||||||
|
.Distinct()
|
||||||
|
.ToList();
|
||||||
|
foreach (var idx in attributes) {
|
||||||
|
var len = vaributes.Count(e => e.EndsWith(idx));
|
||||||
|
foreach (var (v, ks) in rev1) {
|
||||||
|
var myKs = ks.Where(k => k.EndsWith(idx)).ToList();
|
||||||
|
if (myKs.Count > 1 && ((myKs.Count >= len * 0.5 && useDefault) || myKs.Count == len)) {
|
||||||
|
foreach (var k in myKs) data.Remove(k);
|
||||||
|
data[idx] = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach (var (v, ks) in rev2) {
|
||||||
|
var myKs = ks.Where(k => k.EndsWith(idx)).ToList();
|
||||||
|
if (myKs.Count > 1 && ((myKs.Count >= len * 0.5 && useDefault) || myKs.Count == len)) {
|
||||||
|
foreach (var k in myKs) data.Remove(k);
|
||||||
|
data[idx] = v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JsonObject FromGraphEntries(
|
||||||
|
IEnumerable<GraphEntry> graphEntries,
|
||||||
|
BillingData? origData = null,
|
||||||
|
IEnumerable<string>? vaributes = null,
|
||||||
|
bool useDefaultPayment = true,
|
||||||
|
bool useDefaultQuality = true
|
||||||
|
) {
|
||||||
|
var payment = new JsonObject();
|
||||||
|
var qualityWei = new JsonObject();
|
||||||
|
var curves = new JsonArray();
|
||||||
|
int curveId = 0;
|
||||||
|
foreach (var entry in graphEntries) {
|
||||||
|
var curve = GraphEntryToJson(entry);
|
||||||
|
JsonValue node;
|
||||||
|
if (curve is JsonObject obj) {
|
||||||
|
obj["id"] = ++curveId;
|
||||||
|
node = JsonValue.Create($"curve:{curveId}");
|
||||||
|
curves.Add(obj);
|
||||||
|
} else if (curve is JsonValue val && val.TryGetValue<decimal>(out var flat)) {
|
||||||
|
node = JsonValue.Create(flat);
|
||||||
|
} else {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
foreach (var c in entry.Vaributes) {
|
||||||
|
if (entry.Abgewertet) {
|
||||||
|
qualityWei[$"{c.Variety?.SortId}/{c.Attribute?.AttrId}"] = node.DeepClone();
|
||||||
|
} else {
|
||||||
|
payment[$"{c.Variety?.SortId}/{c.Attribute?.AttrId}"] = node.DeepClone();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CollapsePaymentData(payment, vaributes ?? payment.Select(e => e.Key).ToList(), useDefaultPayment);
|
||||||
|
CollapsePaymentData(qualityWei, vaributes ?? qualityWei.Select(e => e.Key).ToList(), useDefaultQuality);
|
||||||
|
|
||||||
|
var data = new JsonObject {
|
||||||
|
["mode"] = "elwig",
|
||||||
|
["version"] = 1,
|
||||||
|
};
|
||||||
|
|
||||||
|
if (origData?.ConsiderDelieryModifiers == true)
|
||||||
|
data["consider_delivery_modifiers"] = true;
|
||||||
|
if (origData?.ConsiderContractPenalties == true)
|
||||||
|
data["consider_contract_penalties"] = true;
|
||||||
|
if (origData?.ConsiderTotalPenalty == true)
|
||||||
|
data["consider_total_penalty"] = true;
|
||||||
|
if (origData?.ConsiderAutoBusinessShares == true)
|
||||||
|
data["consider_auto_business_shares"] = true;
|
||||||
|
|
||||||
|
if (payment.Count == 0) {
|
||||||
|
data["payment"] = 0;
|
||||||
|
} else if (payment.Count == 1 && payment.First().Key == "default") {
|
||||||
|
data["payment"] = payment.Single().Value?.DeepClone();
|
||||||
|
} else {
|
||||||
|
data["payment"] = payment;
|
||||||
|
}
|
||||||
|
if (qualityWei.Count == 1 && qualityWei.First().Key == "default") {
|
||||||
|
data["quality"] = new JsonObject() {
|
||||||
|
["WEI"] = qualityWei.Single().Value?.DeepClone()
|
||||||
|
};
|
||||||
|
} else if (qualityWei.Count >= 1) {
|
||||||
|
data["quality"] = new JsonObject() {
|
||||||
|
["WEI"] = qualityWei
|
||||||
|
};
|
||||||
|
}
|
||||||
|
data["curves"] = curves;
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,25 +15,20 @@ namespace Elwig.Helpers.Billing {
|
|||||||
public BillingVariant(int year, int avnr) : base(year) {
|
public BillingVariant(int year, int avnr) : base(year) {
|
||||||
AvNr = avnr;
|
AvNr = avnr;
|
||||||
PaymentVariant = Context.PaymentVariants.Find(Year, AvNr) ?? throw new ArgumentException("PaymentVar not found");
|
PaymentVariant = Context.PaymentVariants.Find(Year, AvNr) ?? throw new ArgumentException("PaymentVar not found");
|
||||||
var attrVariants = Context.DeliveryParts
|
Data = PaymentBillingData.FromJson(PaymentVariant.Data, Utils.GetVaributes(Context, Year, onlyDelivered: false));
|
||||||
.Where(d => d.Year == Year)
|
|
||||||
.Select(d => $"{d.SortId}{d.AttrId}")
|
|
||||||
.Distinct()
|
|
||||||
.ToList()
|
|
||||||
.Union(Context.WineVarieties.Select(v => v.SortId))
|
|
||||||
.ToList();
|
|
||||||
Data = PaymentBillingData.FromJson(PaymentVariant.Data, attrVariants);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task Calculate() {
|
public async Task Calculate(bool? honorGebunden = null, bool ? allowAttrsIntoLower = null, bool? avoidUnderDeliveries = null) {
|
||||||
using var cnx = await AppDbContext.ConnectAsync();
|
using var cnx = await AppDbContext.ConnectAsync();
|
||||||
using var tx = await cnx.BeginTransactionAsync();
|
using var tx = await cnx.BeginTransactionAsync();
|
||||||
|
await CalculateBuckets(honorGebunden, allowAttrsIntoLower, avoidUnderDeliveries, cnx);
|
||||||
await DeleteInDb(cnx);
|
await DeleteInDb(cnx);
|
||||||
await SetCalcTime(cnx);
|
await SetCalcTime(cnx);
|
||||||
await CalculatePrices(cnx);
|
await CalculatePrices(cnx);
|
||||||
if (Data.ConsiderDelieryModifiers)
|
if (Data.ConsiderDelieryModifiers) {
|
||||||
await CalculateDeliveryModifiers(cnx);
|
await CalculateDeliveryModifiers(cnx);
|
||||||
await CalculateMemberModifiers(cnx);
|
await CalculateMemberModifiers(cnx);
|
||||||
|
}
|
||||||
await tx.CommitAsync();
|
await tx.CommitAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,11 +44,10 @@ namespace Elwig.Helpers.Billing {
|
|||||||
ROUND(p.amount / POW(10, s.precision - 2)) AS net_amount,
|
ROUND(p.amount / POW(10, s.precision - 2)) AS net_amount,
|
||||||
ROUND(lp.amount / POW(10, s.precision - 2)) AS prev_amount,
|
ROUND(lp.amount / POW(10, s.precision - 2)) AS prev_amount,
|
||||||
IIF(m.buchführend, s.vat_normal, s.vat_flatrate) AS vat,
|
IIF(m.buchführend, s.vat_normal, s.vat_flatrate) AS vat,
|
||||||
ROUND(
|
ROUND(IIF({Data.ConsiderContractPenalties}, COALESCE(u.total_penalty, 0), 0) / POW(10, 4 - 2)) +
|
||||||
IIF({Data.ConsiderContractPenalties}, COALESCE(u.total_penalty, 0) / POW(10, 4 - 2), 0) +
|
ROUND(IIF({Data.ConsiderTotalPenalty}, COALESCE(b.total_penalty, 0), 0) / POW(10, s.precision - 2)) +
|
||||||
IIF({Data.ConsiderTotalPenalty}, COALESCE(b.total_penalty, 0), 0) +
|
ROUND(IIF({Data.ConsiderAutoBusinessShares}, -COALESCE(a.total_amount, 0), 0) / POW(10, s.precision - 2))
|
||||||
IIF({Data.ConsiderAutoBusinessShares}, -COALESCE(a.business_shares * s.bs_value, 0), 0) / POW(10, s.precision - 2)
|
AS modifiers,
|
||||||
) AS modifiers,
|
|
||||||
lc.modifiers AS prev_modifiers
|
lc.modifiers AS prev_modifiers
|
||||||
FROM season s
|
FROM season s
|
||||||
JOIN payment_variant v ON v.year = s.year
|
JOIN payment_variant v ON v.year = s.year
|
||||||
@@ -69,26 +63,9 @@ namespace Elwig.Helpers.Billing {
|
|||||||
LEFT JOIN payment_member lp ON (lp.year, lp.avnr, lp.mgnr) = (l.year, l.avnr, m.mgnr)
|
LEFT JOIN payment_member lp ON (lp.year, lp.avnr, lp.mgnr) = (l.year, l.avnr, m.mgnr)
|
||||||
LEFT JOIN payment_member p ON (p.year, p.avnr, p.mgnr) = (v.year, v.avnr, m.mgnr)
|
LEFT JOIN payment_member p ON (p.year, p.avnr, p.mgnr) = (v.year, v.avnr, m.mgnr)
|
||||||
LEFT JOIN credit lc ON (lc.year, lc.avnr, lc.mgnr) = (l.year, l.avnr, m.mgnr)
|
LEFT JOIN credit lc ON (lc.year, lc.avnr, lc.mgnr) = (l.year, l.avnr, m.mgnr)
|
||||||
LEFT JOIN (SELECT year, mgnr,
|
LEFT JOIN v_penalty_area_commitments u ON (u.year, u.mgnr) = (s.year, m.mgnr)
|
||||||
SUM(COALESCE(IIF(u.weight = 0, -t.penalty_none, 0), 0) +
|
LEFT JOIN v_penalty_business_shares b ON (b.year, b.mgnr) = (s.year, m.mgnr)
|
||||||
COALESCE(IIF(u.diff < 0, -t.penalty_amount, 0), 0) +
|
LEFT JOIN v_auto_business_shares a ON (a.year, a.mgnr) = (s.year, m.mgnr)
|
||||||
COALESCE(u.diff * t.penalty_per_kg, 0)) AS total_penalty
|
|
||||||
FROM v_under_delivery u
|
|
||||||
JOIN area_commitment_type t ON t.vtrgid = u.bucket
|
|
||||||
GROUP BY year, mgnr) u ON (u.year, u.mgnr) = (s.year, m.mgnr)
|
|
||||||
LEFT JOIN (SELECT s.year, u.mgnr,
|
|
||||||
(COALESCE(IIF(u.weight = 0, -s.penalty_none, 0), 0) +
|
|
||||||
COALESCE(IIF(u.diff < 0, -s.penalty_amount, 0), 0) +
|
|
||||||
COALESCE(u.diff * s.penalty_per_kg, 0)
|
|
||||||
) / POW(10, s.precision - 2) AS total_penalty
|
|
||||||
FROM v_total_under_delivery u
|
|
||||||
JOIN season s ON s.year = u.year
|
|
||||||
WHERE u.diff < 0) b ON (b.year, b.mgnr) = (s.year, m.mgnr)
|
|
||||||
LEFT JOIN (SELECT h.mgnr, h.business_shares
|
|
||||||
FROM member_history h
|
|
||||||
WHERE type = 'auto' AND
|
|
||||||
date >= '{Year}-06-01' AND
|
|
||||||
date < '{Year + 1}-06-01') a ON a.mgnr = m.mgnr
|
|
||||||
WHERE s.year = {Year} AND v.avnr = {AvNr};
|
WHERE s.year = {Year} AND v.avnr = {AvNr};
|
||||||
|
|
||||||
UPDATE payment_variant SET test_variant = FALSE WHERE (year, avnr) = ({Year}, {AvNr});
|
UPDATE payment_variant SET test_variant = FALSE WHERE (year, avnr) = ({Year}, {AvNr});
|
||||||
@@ -146,10 +123,10 @@ namespace Elwig.Helpers.Billing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async Task CalculatePrices(SqliteConnection cnx) {
|
protected async Task CalculatePrices(SqliteConnection cnx) {
|
||||||
var parts = new List<(int Year, int DId, int DPNr, int BktNr, string SortId, string Discr, int Value, double Oe, double Kmw, string QualId)>();
|
var parts = new List<(int Year, int DId, int DPNr, int BktNr, string SortId, string? AttrId, string Discr, int Value, double Oe, double Kmw, string QualId)>();
|
||||||
using (var cmd = cnx.CreateCommand()) {
|
using (var cmd = cnx.CreateCommand()) {
|
||||||
cmd.CommandText = $"""
|
cmd.CommandText = $"""
|
||||||
SELECT d.year, d.did, d.dpnr, b.bktnr, d.sortid, b.discr, b.value, d.oe, d.kmw, d.qualid
|
SELECT d.year, d.did, d.dpnr, b.bktnr, d.sortid, d.attrid, b.discr, b.value, d.oe, d.kmw, d.qualid
|
||||||
FROM delivery_part_bucket b
|
FROM delivery_part_bucket b
|
||||||
JOIN v_delivery d ON (d.year, d.did, d.dpnr) = (b.year, b.did, b.dpnr)
|
JOIN v_delivery d ON (d.year, d.did, d.dpnr) = (b.year, b.did, b.dpnr)
|
||||||
WHERE b.year = {Year}
|
WHERE b.year = {Year}
|
||||||
@@ -158,16 +135,19 @@ namespace Elwig.Helpers.Billing {
|
|||||||
while (await reader.ReadAsync()) {
|
while (await reader.ReadAsync()) {
|
||||||
parts.Add((
|
parts.Add((
|
||||||
reader.GetInt32(0), reader.GetInt32(1), reader.GetInt32(2), reader.GetInt32(3),
|
reader.GetInt32(0), reader.GetInt32(1), reader.GetInt32(2), reader.GetInt32(3),
|
||||||
reader.GetString(4), reader.GetString(5), reader.GetInt32(6),
|
reader.GetString(4), reader.IsDBNull(5) ? null : reader.GetString(5), reader.GetString(6),
|
||||||
reader.GetDouble(7), reader.GetDouble(8), reader.GetString(9)
|
reader.GetInt32(7), reader.GetDouble(8), reader.GetDouble(9), reader.GetString(10)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var inserts = new List<(int Year, int DId, int DPNr, int BktNr, long Price, long Amount)>();
|
var inserts = new List<(int Year, int DId, int DPNr, int BktNr, long Price, long Amount)>();
|
||||||
foreach (var part in parts) {
|
foreach (var part in parts) {
|
||||||
var attrId = (part.Discr == "_" || part.Discr == "") ? null : part.Discr;
|
var ungeb = part.Discr == "_";
|
||||||
var price = Data.CalculatePrice(part.SortId, attrId, part.QualId, part.Discr != "_", part.Oe, part.Kmw);
|
var payAttrId = (part.Discr is "" or "_") ? null : part.Discr;
|
||||||
|
var attrId = part.AttrId == "B" ? "B" : payAttrId; // FIXME
|
||||||
|
var geb = !ungeb; // FIXME && payAttrId == part.AttrId;
|
||||||
|
var price = Data.CalculatePrice(part.SortId, attrId, part.QualId, geb, part.Oe, part.Kmw);
|
||||||
var priceL = PaymentVariant.Season.DecToDb(price);
|
var priceL = PaymentVariant.Season.DecToDb(price);
|
||||||
inserts.Add((part.Year, part.DId, part.DPNr, part.BktNr, priceL, priceL * part.Value));
|
inserts.Add((part.Year, part.DId, part.DPNr, part.BktNr, priceL, priceL * part.Value));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,27 @@
|
|||||||
using System.Collections.Generic;
|
using Elwig.Models.Entities;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json.Nodes;
|
using System.Text.Json.Nodes;
|
||||||
|
|
||||||
namespace Elwig.Helpers.Billing {
|
namespace Elwig.Helpers.Billing {
|
||||||
public class EditBillingData : BillingData {
|
public class EditBillingData : BillingData {
|
||||||
|
|
||||||
protected readonly IEnumerable<string> AttributeVariants;
|
protected readonly IEnumerable<string> Vaributes;
|
||||||
|
|
||||||
public EditBillingData(JsonObject data, IEnumerable<string> attributeVariants) :
|
public EditBillingData(JsonObject data, IEnumerable<string> vaributes) :
|
||||||
base(data) {
|
base(data) {
|
||||||
AttributeVariants = attributeVariants;
|
Vaributes = vaributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EditBillingData FromJson(string json, IEnumerable<string> attributeVariants) {
|
public static EditBillingData FromJson(string json, IEnumerable<string> vaributes) {
|
||||||
return new(ParseJson(json), attributeVariants);
|
return new(ParseJson(json), vaributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<GraphEntry> GetPaymentGraphEntries() {
|
private (Dictionary<int, Curve>, Dictionary<int, List<string>>) GetGraphEntries(JsonNode root) {
|
||||||
Dictionary<int, List<string>> dict1 = [];
|
Dictionary<int, List<string>> dict1 = [];
|
||||||
Dictionary<decimal, List<string>> dict2 = [];
|
Dictionary<decimal, List<string>> dict2 = [];
|
||||||
var p = GetPaymentEntry();
|
if (root is JsonObject paymentObj) {
|
||||||
if (p is JsonObject paymentObj) {
|
|
||||||
foreach (var (selector, node) in paymentObj) {
|
foreach (var (selector, node) in paymentObj) {
|
||||||
var val = node?.AsValue();
|
var val = node?.AsValue();
|
||||||
if (val == null) {
|
if (val == null) {
|
||||||
@@ -34,56 +35,71 @@ namespace Elwig.Helpers.Billing {
|
|||||||
dict1[idx].Add(selector);
|
dict1[idx].Add(selector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (p is JsonValue paymentVal) {
|
} else if (root is JsonValue paymentVal) {
|
||||||
var idx = paymentVal.GetValue<decimal>();
|
if (paymentVal.TryGetValue<decimal>(out var price)) {
|
||||||
if (!dict2.ContainsKey(idx)) dict2[idx] = [];
|
if (!dict2.ContainsKey(price)) dict2[price] = [];
|
||||||
dict2[idx].Add("default");
|
dict2[price].Add("default");
|
||||||
|
} else if (paymentVal.TryGetValue<string>(out var curve)) {
|
||||||
|
var idx = int.Parse(curve.Split(":")[1] ?? "0");
|
||||||
|
if (!dict1.ContainsKey(idx)) dict1[idx] = [];
|
||||||
|
dict1[idx].Add("default");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var virtOffset = dict1.Count > 0 ? dict1.Max(e => e.Key) + 1 : 1;
|
||||||
Dictionary<int, Curve> curves = GetCurves();
|
Dictionary<int, Curve> curves = GetCurves();
|
||||||
decimal[] virtCurves = [.. dict2.Keys.Order()];
|
decimal[] virtCurves = [.. dict2.Keys.Order()];
|
||||||
for (int i = 0; i < virtCurves.Length; i++) {
|
for (int i = 0; i < virtCurves.Length; i++) {
|
||||||
var idx = virtCurves[i];
|
var idx = virtCurves[i];
|
||||||
dict1[1000 + i] = dict2[idx];
|
dict1[i + virtOffset] = dict2[idx];
|
||||||
curves[1000 + i] = new Curve(CurveMode.Oe, new() { { 73, idx } }, null);
|
curves[i + virtOffset] = new Curve(CurveMode.Oe, new() { { 73, idx } }, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
Dictionary<int, List<string>> dict3 = [];
|
Dictionary<int, List<string>> dict3 = curves.ToDictionary(c => c.Key, _ => new List<string>());
|
||||||
|
foreach (var (selector, value) in GetSelection(root, Vaributes)) {
|
||||||
|
int? idx = null;
|
||||||
|
if (value.TryGetValue<decimal>(out var val)) {
|
||||||
|
idx = Array.IndexOf(virtCurves, val) + virtOffset;
|
||||||
|
} else if (value.TryGetValue<string>(out var str)) {
|
||||||
|
idx = int.Parse(str.Split(":")[1]);
|
||||||
|
}
|
||||||
|
if (idx != null)
|
||||||
|
dict3[(int)idx].Add(selector);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (curves, dict3);
|
||||||
|
|
||||||
return dict3.Select(e => new GraphEntry(e.Key, curves[e.Key], 50, 120)).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<GraphEntry> GetQualityGraphEntries() {
|
private static List<GraphEntry> CreateGraphEntries(
|
||||||
Dictionary<int, List<string>> dict1 = [];
|
AppDbContext ctx, int precision,
|
||||||
Dictionary<decimal, List<string>> dict2 = [];
|
Dictionary<int, Curve> curves,
|
||||||
foreach (var (qualid, q) in GetQualityEntry() ?? []) {
|
Dictionary<int, List<string>> entries
|
||||||
if (q is JsonObject qualityObj) {
|
) {
|
||||||
foreach (var (selector, node) in qualityObj) {
|
var vars = ctx.WineVarieties.ToDictionary(v => v.SortId, v => v);
|
||||||
var val = node?.AsValue();
|
var attrs = ctx.WineAttributes.ToDictionary(a => a.AttrId, a => a);
|
||||||
if (val == null) {
|
return entries
|
||||||
continue;
|
.Select(e => new GraphEntry(e.Key, precision, curves[e.Key], e.Value
|
||||||
} else if (val.TryGetValue<decimal>(out var price)) {
|
.Select(s => new Varibute(vars[s[..2]], s.Length > 2 ? attrs[s[2..]] : null))
|
||||||
if (!dict2.ContainsKey(price)) dict2[price] = [];
|
.ToList()))
|
||||||
dict2[price].Add(selector);
|
.ToList();
|
||||||
} else if (val.TryGetValue<string>(out var curve)) {
|
}
|
||||||
var idx = int.Parse(curve.Split(":")[1] ?? "0");
|
|
||||||
if (!dict1.ContainsKey(idx)) dict1[idx] = [];
|
public IEnumerable<GraphEntry> GetPaymentGraphEntries(AppDbContext ctx, Season season) {
|
||||||
dict1[idx].Add(selector);
|
var root = GetPaymentEntry();
|
||||||
}
|
var (curves, entries) = GetGraphEntries(root);
|
||||||
}
|
return CreateGraphEntries(ctx, season.Precision, curves, entries).Where(e => e.Vaributes.Count > 0);
|
||||||
} else if (q is JsonValue qualityVal) {
|
}
|
||||||
var idx = qualityVal.GetValue<decimal>();
|
|
||||||
if (!dict2.ContainsKey(idx)) dict2[idx] = [];
|
public IEnumerable<GraphEntry> GetQualityGraphEntries(AppDbContext ctx, Season season, int idOffset = 0) {
|
||||||
dict2[idx].Add($"{qualid}/");
|
var root = GetQualityEntry();
|
||||||
}
|
if (root == null || root["WEI"] is not JsonNode qualityWei)
|
||||||
|
return [];
|
||||||
|
var (curves, entries) = GetGraphEntries(qualityWei);
|
||||||
|
var list = CreateGraphEntries(ctx, season.Precision, curves, entries).Where(e => e.Vaributes.Count > 0);
|
||||||
|
foreach (var e in list) {
|
||||||
|
e.Id += idOffset;
|
||||||
|
e.Abgewertet = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
|
|
||||||
List<GraphEntry> list = [];
|
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,107 +1,107 @@
|
|||||||
using ScottPlot;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
|
|
||||||
namespace Elwig.Helpers.Billing {
|
namespace Elwig.Helpers.Billing {
|
||||||
public class Graph : ICloneable {
|
public class Graph : ICloneable {
|
||||||
|
|
||||||
|
public readonly int Precision;
|
||||||
public double[] DataX { get; set; }
|
public double[] DataX { get; set; }
|
||||||
public double[] DataY { get; set; }
|
public double[] DataY { get; set; }
|
||||||
|
public int MinX { get; set; }
|
||||||
|
public int MaxX { get; set; }
|
||||||
|
|
||||||
public Graph(int minX, int maxX) {
|
public Graph(int precision, int minX, int maxX) {
|
||||||
DataX = DataGen.Range(minX, maxX + 1);
|
Precision = precision;
|
||||||
DataY = DataGen.Zeros(maxX - minX + 1);
|
MinX = minX;
|
||||||
|
MaxX = maxX;
|
||||||
|
DataX = Enumerable.Range(minX, maxX - minX + 1).Select(n => (double)n).ToArray();
|
||||||
|
DataY = new double[DataX.Length];
|
||||||
}
|
}
|
||||||
|
|
||||||
public Graph(Dictionary<double, decimal> data, int minX, int maxX) {
|
public Graph(Dictionary<double, decimal> data, int precision, int minX, int maxX) {
|
||||||
DataX = DataGen.Range(minX, maxX + 1);
|
Precision = precision;
|
||||||
DataY = DataGen.Zeros(maxX - minX + 1);
|
MinX = minX;
|
||||||
ParseGraphData(data, minX, maxX);
|
MaxX = maxX;
|
||||||
|
DataX = Enumerable.Range(minX, maxX - minX + 1).Select(n => (double)n).ToArray();
|
||||||
|
DataY = DataX.Select(i => (double)BillingData.GetCurveValueAt(data, i)).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Graph(double[] dataX, double[] dataY) {
|
public Graph(double[] values, int precision, int minX, int maxX) {
|
||||||
|
Precision = precision;
|
||||||
|
MinX = minX;
|
||||||
|
MaxX = maxX;
|
||||||
|
DataX = Enumerable.Range(MinX, MaxX - MinX + 1).Select(i => (double)i).ToArray();
|
||||||
|
DataY = values;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Graph(double[] dataX, double[] dataY, int precision, int minX, int maxX) {
|
||||||
|
Precision = precision;
|
||||||
|
MinX = minX;
|
||||||
|
MaxX = maxX;
|
||||||
DataX = dataX;
|
DataX = dataX;
|
||||||
DataY = dataY;
|
DataY = dataY;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParseGraphData(Dictionary<double, decimal> graphPoints, int minX, int maxX) {
|
public double GetOechsleAt(int index) {
|
||||||
if (graphPoints.Keys.Count < 1) {
|
return DataX[index];
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var minKey = graphPoints.Keys.Order().First();
|
|
||||||
var maxKey = graphPoints.Keys.OrderDescending().First();
|
|
||||||
|
|
||||||
if (!graphPoints.ContainsKey(minX)) {
|
|
||||||
graphPoints.Add(minX, graphPoints.GetValueOrDefault(minKey));
|
|
||||||
}
|
|
||||||
if (!graphPoints.ContainsKey(maxX)) {
|
|
||||||
graphPoints.Add(maxX, graphPoints.GetValueOrDefault(maxKey));
|
|
||||||
}
|
|
||||||
|
|
||||||
var keys = graphPoints.Keys.Order().ToArray();
|
|
||||||
|
|
||||||
for (int i = 0; i < keys.Length; i++) {
|
|
||||||
decimal point1Value = graphPoints[keys[i]];
|
|
||||||
if (i + 1 < keys.Length) {
|
|
||||||
decimal point2Value = graphPoints[keys[i + 1]];
|
|
||||||
if (point1Value == point2Value) {
|
|
||||||
for (int j = (int)(keys[i] - minX); j < keys[i + 1] - minX; j++) {
|
|
||||||
DataY[j] = (double)point1Value;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int steps = (int)Math.Abs(keys[i + 1] - keys[i]);
|
|
||||||
decimal step = (point2Value - point1Value) / steps;
|
|
||||||
|
|
||||||
DataY[(int)(keys[i] - minX)] = (double)point1Value;
|
|
||||||
DataY[(int)(keys[i + 1] - minX)] = (double)point2Value;
|
|
||||||
|
|
||||||
for (int j = (int)(keys[i] - minX); j < keys[i + 1] - minX - 1; j++) {
|
|
||||||
DataY[j + 1] = Math.Round(DataY[j] + (double)step, 4); // TODO richtig runden
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
for (int j = (int)(keys[i] - minX); j < DataX.Length; j++) {
|
|
||||||
DataY[j] = (double)point1Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FlattenGraph(int begin, int end, double value) {
|
public void SetOechsleAt(int index, double oechsle) {
|
||||||
|
DataX[index] = oechsle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPriceAt(int index, double price) {
|
||||||
|
DataY[index] = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double GetPriceAt(int index) {
|
||||||
|
return DataY[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
public double GetPriceAtOe(double oe) {
|
||||||
|
return DataY[Array.IndexOf(DataX, oe)];
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FlattenGraph(int begin, int end, double value) {
|
||||||
for (int i = begin; i <= end; i++) {
|
for (int i = begin; i <= end; i++) {
|
||||||
DataY[i] = value;
|
DataY[i] = value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LinearIncreaseGraph(int begin, int end, double inc) {
|
public void FlattenGraphLeft(int pointIndex) {
|
||||||
|
FlattenGraph(0, pointIndex, DataY[pointIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FlattenGraphRight(int pointIndex) {
|
||||||
|
FlattenGraph(pointIndex, DataY.Length - 1, DataY[pointIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinearIncreaseGraph(int begin, int end, double inc) {
|
||||||
for (int i = begin; i < end; i++) {
|
for (int i = begin; i < end; i++) {
|
||||||
DataY[i + 1] = DataY[i] + inc;
|
DataY[i + 1] = Math.Round(DataY[i] + inc, Precision);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public JsonObject ToJson(string mode) {
|
public void LinearIncreaseGraphToEnd(int begin, double inc) {
|
||||||
var data = new JsonObject();
|
LinearIncreaseGraph(begin, DataY.Length - 1, inc);
|
||||||
|
}
|
||||||
|
|
||||||
if (DataY[0] != DataY[1]) {
|
public void InterpolateGraph(int firstPoint, int secondPoint) {
|
||||||
data.Add(new KeyValuePair<string, JsonNode?>(DataX[0] + mode, Math.Round(DataY[0], 4)));
|
int steps = Math.Abs(firstPoint - secondPoint);
|
||||||
|
if (firstPoint == -1 || secondPoint == -1 || steps < 2) {
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
for (int i = 1; i < DataX.Length - 1; i++) {
|
var (lowIndex, highIndex) = firstPoint < secondPoint ? (firstPoint, secondPoint) : (secondPoint, firstPoint);
|
||||||
if (Math.Round(DataY[i] - DataY[i - 1], 10) != Math.Round(DataY[i + 1] - DataY[i], 10)) {
|
double step = (DataY[highIndex] - DataY[lowIndex]) / steps;
|
||||||
data.Add(new KeyValuePair<string, JsonNode?>(DataX[i] + mode, Math.Round(DataY[i], 4)));
|
|
||||||
}
|
for (int i = lowIndex; i < highIndex - 1; i++) {
|
||||||
|
DataY[i + 1] = Math.Round(DataY[i] + step, Precision);
|
||||||
}
|
}
|
||||||
if (DataY[^1] != DataY[^2]) {
|
|
||||||
data.Add(new KeyValuePair<string, JsonNode?>(DataX[^1] + mode, Math.Round(DataY[^1], 4)));
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public object Clone() {
|
public object Clone() {
|
||||||
return new Graph((double[])DataX.Clone(), (double[])DataY.Clone());
|
return new Graph((double[])DataX.Clone(), (double[])DataY.Clone(), Precision, MinX, MaxX);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,70 +1,88 @@
|
|||||||
using System.Collections.Generic;
|
using System;
|
||||||
using System.Text.Json.Nodes;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Elwig.Helpers.Billing {
|
namespace Elwig.Helpers.Billing {
|
||||||
public class GraphEntry {
|
public class GraphEntry {
|
||||||
|
|
||||||
|
public const int MinX = 50;
|
||||||
|
public const int MinXGeb = 73;
|
||||||
|
public const int MaxX = 120;
|
||||||
|
|
||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
public BillingData.CurveMode Mode { get; set; }
|
public BillingData.CurveMode Mode { get; set; }
|
||||||
|
public bool Abgewertet { get; set; }
|
||||||
|
|
||||||
public Graph DataGraph { get; set; }
|
public Graph DataGraph { get; set; }
|
||||||
public Graph? GebundenGraph { get; set; }
|
public Graph? GebundenGraph { get; set; }
|
||||||
public decimal? GebundenFlatPrice { get; set; }
|
public double? GebundenFlatBonus {
|
||||||
public List<string> Contracts { get; set; }
|
get {
|
||||||
private int MinX { get; set; }
|
try {
|
||||||
private int MaxX { get; set; }
|
var val = GebundenGraph?.DataX.Zip(GebundenGraph.DataY)
|
||||||
|
.Select(e => Math.Round(e.Second - DataGraph.GetPriceAtOe(e.First), Precision))
|
||||||
|
.Distinct()
|
||||||
|
.Single();
|
||||||
|
return (val == 0) ? null : val;
|
||||||
|
} catch {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
set {
|
||||||
|
if (value is not double v) return;
|
||||||
|
var values = Enumerable.Range(MinXGeb, MaxX - MinXGeb + 1)
|
||||||
|
.Select(i => Math.Round(DataGraph.GetPriceAtOe(i) + v, Precision))
|
||||||
|
.ToArray();
|
||||||
|
GebundenGraph = new Graph(values, Precision, MinXGeb, MaxX);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public GraphEntry(int id, BillingData.CurveMode mode, int minX, int maxX) {
|
public List<Varibute> Vaributes { get; set; }
|
||||||
|
public string VaributeStringSimple => (Abgewertet ? "Abgew.: " : "") + (Vaributes.Count != 0 ? (Vaributes.Count >= 25 ? "Restliche Sorten" : string.Join(", ", Vaributes.Select(c => c.Listing))) : "-");
|
||||||
|
public string VaributeString => Vaributes.Count != 0 ? string.Join("\n", Vaributes.Select(c => c.FullName)) : "-";
|
||||||
|
public string VaributeStringChange => (Abgewertet ? "A." : "") + string.Join(",", Vaributes.Select(c => c.Listing));
|
||||||
|
private readonly int Precision;
|
||||||
|
|
||||||
|
public GraphEntry(int id, int precision, BillingData.CurveMode mode) {
|
||||||
Id = id;
|
Id = id;
|
||||||
|
Precision = precision;
|
||||||
Mode = mode;
|
Mode = mode;
|
||||||
MinX = minX;
|
DataGraph = new Graph(precision, MinX, MaxX); ;
|
||||||
MaxX = maxX;
|
Vaributes = [];
|
||||||
DataGraph = new Graph(minX, maxX);
|
|
||||||
Contracts = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GraphEntry(int id, BillingData.CurveMode mode, Dictionary<double, decimal> data, int minX, int maxX) :
|
public GraphEntry(int id, int precision, BillingData.CurveMode mode, Dictionary<double, decimal> data, Dictionary<double, decimal>? gebunden) :
|
||||||
this(id, mode, minX, maxX) {
|
this(id, precision, mode) {
|
||||||
DataGraph = new Graph(data, minX, maxX);
|
DataGraph = new Graph(data, precision, MinX, MaxX);
|
||||||
|
if (gebunden != null) GebundenGraph = new Graph(gebunden, precision, MinXGeb, MaxX);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GraphEntry(int id, BillingData.Curve curve, int minX, int maxX) :
|
public GraphEntry(int id, int precision, BillingData.Curve curve, List<Varibute> vaributes) :
|
||||||
this(id, curve.Mode, minX, maxX) {
|
this(id, precision, curve.Mode) {
|
||||||
DataGraph = new Graph(curve.Normal, minX, maxX);
|
DataGraph = new Graph(curve.Normal, precision, MinX, MaxX);
|
||||||
if (curve.Gebunden != null)
|
if (curve.Gebunden != null)
|
||||||
GebundenGraph = new Graph(curve.Gebunden, minX, maxX);
|
GebundenGraph = new Graph(curve.Gebunden, precision, MinXGeb, MaxX);
|
||||||
|
Vaributes = vaributes;
|
||||||
}
|
}
|
||||||
|
|
||||||
private GraphEntry(int id, BillingData.CurveMode mode, Graph dataGraph, Graph? gebundenGraph,
|
private GraphEntry(int id, int precision, BillingData.CurveMode mode, Graph dataGraph, Graph? gebundenGraph, List<Varibute> vaributes) {
|
||||||
decimal? gebundenFlatPrice, List<string> contracts, int minX, int maxX) {
|
|
||||||
Id = id;
|
Id = id;
|
||||||
|
Precision = precision;
|
||||||
Mode = mode;
|
Mode = mode;
|
||||||
MinX = minX;
|
|
||||||
MaxX = maxX;
|
|
||||||
DataGraph = dataGraph;
|
DataGraph = dataGraph;
|
||||||
GebundenGraph = gebundenGraph;
|
GebundenGraph = gebundenGraph;
|
||||||
GebundenFlatPrice = gebundenFlatPrice;
|
Vaributes = vaributes;
|
||||||
Contracts = contracts;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public JsonObject ToJson() {
|
public void AddGebundenGraph() {
|
||||||
var curve = new JsonObject {
|
GebundenGraph ??= new Graph(Precision, MinXGeb, MaxX);
|
||||||
["id"] = Id,
|
}
|
||||||
["mode"] = Mode.ToString().ToLower(),
|
|
||||||
};
|
|
||||||
|
|
||||||
curve["data"] = DataGraph.ToJson(Mode.ToString().ToLower());
|
public void RemoveGebundenGraph() {
|
||||||
|
GebundenGraph = null;
|
||||||
if (GebundenFlatPrice != null) {
|
|
||||||
curve["geb"] = GebundenFlatPrice.ToString();
|
|
||||||
} else if (GebundenGraph != null) {
|
|
||||||
curve["geb"] = GebundenGraph.ToJson(Mode.ToString().ToLower());
|
|
||||||
}
|
|
||||||
|
|
||||||
return curve;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GraphEntry Copy(int id) {
|
public GraphEntry Copy(int id) {
|
||||||
return new GraphEntry(id, Mode, (Graph)DataGraph.Clone(), (Graph?)GebundenGraph?.Clone(), GebundenFlatPrice, Contracts, MinX, MaxX);
|
return new GraphEntry(id, Precision, Mode, (Graph)DataGraph.Clone(), (Graph?)GebundenGraph?.Clone(), []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json.Nodes;
|
using System.Text.Json.Nodes;
|
||||||
|
|
||||||
@@ -10,61 +9,28 @@ namespace Elwig.Helpers.Billing {
|
|||||||
protected readonly Dictionary<int, Curve> Curves;
|
protected readonly Dictionary<int, Curve> Curves;
|
||||||
protected readonly Dictionary<string, Curve> PaymentData;
|
protected readonly Dictionary<string, Curve> PaymentData;
|
||||||
protected readonly Dictionary<string, Curve> QualityData;
|
protected readonly Dictionary<string, Curve> QualityData;
|
||||||
protected readonly IEnumerable<string> AttributeVariants;
|
protected readonly IEnumerable<string> Vaributes;
|
||||||
|
|
||||||
public PaymentBillingData(JsonObject data, IEnumerable<string> attributeVariants) :
|
public PaymentBillingData(JsonObject data, IEnumerable<string> vaributes) :
|
||||||
base(data) {
|
base(data) {
|
||||||
if (attributeVariants.Any(e => e.Any(c => c < 'A' || c > 'Z')))
|
if (vaributes.Any(e => e.Any(c => c < 'A' || c > 'Z')))
|
||||||
throw new ArgumentException("Invalid attributeVariants");
|
throw new ArgumentException("Invalid vaributes");
|
||||||
AttributeVariants = attributeVariants;
|
Vaributes = vaributes;
|
||||||
Curves = GetCurves();
|
Curves = GetCurves();
|
||||||
PaymentData = GetPaymentData();
|
PaymentData = GetPaymentData();
|
||||||
QualityData = GetQualityData();
|
QualityData = GetQualityData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static PaymentBillingData FromJson(string json, IEnumerable<string> attributeVariants) {
|
public static PaymentBillingData FromJson(string json, IEnumerable<string> vaributes) {
|
||||||
return new(ParseJson(json), attributeVariants);
|
return new(ParseJson(json), vaributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Dictionary<string, Curve> GetData(JsonObject data) {
|
private Dictionary<string, Curve> GetData(JsonNode data) {
|
||||||
Dictionary<string, Curve> dict;
|
return GetSelection(data, Vaributes).ToDictionary(e => e.Key, e => LookupCurve(e.Value));
|
||||||
if (data["default"] is JsonValue def) {
|
|
||||||
var c = LookupCurve(def);
|
|
||||||
dict = AttributeVariants.ToDictionary(e => e, _ => c);
|
|
||||||
} else {
|
|
||||||
dict = [];
|
|
||||||
}
|
|
||||||
|
|
||||||
var variants = data.Where(p => !p.Key.StartsWith('/') && p.Key.Length == 2);
|
|
||||||
var attributes = data.Where(p => p.Key.StartsWith('/'));
|
|
||||||
var others = data.Where(p => !p.Key.StartsWith('/') && p.Key.Length > 2);
|
|
||||||
foreach (var (idx, v) in variants) {
|
|
||||||
var curve = LookupCurve(v?.AsValue() ?? throw new InvalidOperationException());
|
|
||||||
foreach (var i in AttributeVariants.Where(e => e.StartsWith(idx[..^1]))) {
|
|
||||||
dict[i] = curve;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach (var (idx, v) in attributes) {
|
|
||||||
var curve = LookupCurve(v?.AsValue() ?? throw new InvalidOperationException());
|
|
||||||
foreach (var i in AttributeVariants.Where(e => e[2..] == idx[1..])) {
|
|
||||||
dict[i] = curve;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
foreach (var (idx, v) in others) {
|
|
||||||
var curve = LookupCurve(v?.AsValue() ?? throw new InvalidOperationException());
|
|
||||||
dict[idx.Replace("/", "")] = curve;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dict;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Dictionary<string, Curve> GetPaymentData() {
|
protected Dictionary<string, Curve> GetPaymentData() {
|
||||||
var p = GetPaymentEntry();
|
return GetData(GetPaymentEntry());
|
||||||
if (p is JsonValue val) {
|
|
||||||
var c = LookupCurve(val);
|
|
||||||
return AttributeVariants.ToDictionary(e => e, _ => c);
|
|
||||||
}
|
|
||||||
return GetData(p?.AsObject() ?? throw new InvalidOperationException());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Dictionary<string, Curve> GetQualityData() {
|
protected Dictionary<string, Curve> GetQualityData() {
|
||||||
@@ -73,14 +39,7 @@ namespace Elwig.Helpers.Billing {
|
|||||||
if (q == null) return dict;
|
if (q == null) return dict;
|
||||||
|
|
||||||
foreach (var (qualid, data) in q) {
|
foreach (var (qualid, data) in q) {
|
||||||
Dictionary<string, Curve> qualDict;
|
foreach (var (idx, d) in GetData(data ?? throw new InvalidOperationException())) {
|
||||||
if (data is JsonValue val) {
|
|
||||||
var c = LookupCurve(val);
|
|
||||||
qualDict = AttributeVariants.ToDictionary(e => e, _ => c);
|
|
||||||
} else {
|
|
||||||
qualDict = GetData(data?.AsObject() ?? throw new InvalidOperationException());
|
|
||||||
}
|
|
||||||
foreach (var (idx, d) in qualDict) {
|
|
||||||
dict[$"{qualid}/{idx}"] = d;
|
dict[$"{qualid}/{idx}"] = d;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -90,25 +49,7 @@ namespace Elwig.Helpers.Billing {
|
|||||||
|
|
||||||
public decimal CalculatePrice(string sortid, string? attrid, string qualid, bool gebunden, double oe, double kmw) {
|
public decimal CalculatePrice(string sortid, string? attrid, string qualid, bool gebunden, double oe, double kmw) {
|
||||||
var curve = GetQualityCurve(qualid, sortid, attrid) ?? GetCurve(sortid, attrid);
|
var curve = GetQualityCurve(qualid, sortid, attrid) ?? GetCurve(sortid, attrid);
|
||||||
var d = (gebunden ? curve.Gebunden : null) ?? curve.Normal;
|
return GetCurveValueAt((gebunden ? curve.Gebunden : null) ?? curve.Normal, curve.Mode == CurveMode.Oe ? oe : kmw);
|
||||||
if (d.Count == 1) return d.First().Value;
|
|
||||||
|
|
||||||
var r = curve.Mode == CurveMode.Oe ? oe : kmw;
|
|
||||||
var lt = d.Keys.Where(v => v <= r);
|
|
||||||
var gt = d.Keys.Where(v => v >= r);
|
|
||||||
if (!lt.Any()) {
|
|
||||||
return d[gt.Min()];
|
|
||||||
} else if (!gt.Any()) {
|
|
||||||
return d[lt.Max()];
|
|
||||||
}
|
|
||||||
|
|
||||||
var max = lt.Max();
|
|
||||||
var min = gt.Min();
|
|
||||||
if (max == min) return d[r];
|
|
||||||
|
|
||||||
var p1 = ((decimal)r - (decimal)min) / ((decimal)max - (decimal)min);
|
|
||||||
var p2 = 1 - p1;
|
|
||||||
return d[min] * p2 + d[max] * p1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Curve LookupCurve(JsonValue val) {
|
private Curve LookupCurve(JsonValue val) {
|
||||||
@@ -122,11 +63,11 @@ namespace Elwig.Helpers.Billing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected Curve GetCurve(string sortid, string? attrid) {
|
protected Curve GetCurve(string sortid, string? attrid) {
|
||||||
return PaymentData[$"{sortid}{attrid ?? ""}"];
|
return PaymentData[$"{sortid}{attrid}"];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Curve? GetQualityCurve(string qualid, string sortid, string? attrid) {
|
protected Curve? GetQualityCurve(string qualid, string sortid, string? attrid) {
|
||||||
return QualityData.TryGetValue($"{qualid}/{sortid}{attrid ?? ""}", out var curve) ? curve : null;
|
return QualityData.TryGetValue($"{qualid}/{sortid}{attrid}", out var curve) ? curve : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
using Elwig.Models.Entities;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Elwig.Helpers.Billing {
|
||||||
|
public class Varibute : IComparable<Varibute> {
|
||||||
|
|
||||||
|
public WineVar? Variety { get; }
|
||||||
|
public WineAttr? Attribute { get; }
|
||||||
|
public int? AssignedGraphId { get; set; }
|
||||||
|
public int? AssignedAbgewGraphId { get; set; }
|
||||||
|
|
||||||
|
public string Listing => $"{Variety?.SortId}{Attribute?.AttrId}";
|
||||||
|
public string FullName => $"{Variety?.Name}" + (Variety != null && Attribute != null ? " " : "") + $"{Attribute?.Name}";
|
||||||
|
|
||||||
|
public Varibute(WineVar? var, WineAttr? attr) {
|
||||||
|
Variety = var;
|
||||||
|
Attribute = attr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString() {
|
||||||
|
return Listing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int CompareTo(Varibute? other) {
|
||||||
|
return Listing.CompareTo(other?.Listing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -60,6 +60,7 @@ namespace Elwig.Helpers {
|
|||||||
|
|
||||||
public string? TextDeliveryNote;
|
public string? TextDeliveryNote;
|
||||||
public string? TextDeliveryConfirmation;
|
public string? TextDeliveryConfirmation;
|
||||||
|
public string? TextCreditNote;
|
||||||
|
|
||||||
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)) { }
|
||||||
|
|
||||||
@@ -99,6 +100,8 @@ namespace Elwig.Helpers {
|
|||||||
if (TextDeliveryNote == "") TextDeliveryNote = null;
|
if (TextDeliveryNote == "") TextDeliveryNote = null;
|
||||||
TextDeliveryConfirmation = parameters.GetValueOrDefault("TEXT_DELIVERYCONFIRMATION");
|
TextDeliveryConfirmation = parameters.GetValueOrDefault("TEXT_DELIVERYCONFIRMATION");
|
||||||
if (TextDeliveryConfirmation == "") TextDeliveryConfirmation = null;
|
if (TextDeliveryConfirmation == "") TextDeliveryConfirmation = null;
|
||||||
|
TextCreditNote = parameters.GetValueOrDefault("TEXT_CREDITNOTE");
|
||||||
|
if (TextCreditNote == "") TextCreditNote = null;
|
||||||
} catch {
|
} catch {
|
||||||
throw new KeyNotFoundException();
|
throw new KeyNotFoundException();
|
||||||
}
|
}
|
||||||
@@ -133,6 +136,7 @@ namespace Elwig.Helpers {
|
|||||||
("DOCUMENT_SENDER", Sender2),
|
("DOCUMENT_SENDER", Sender2),
|
||||||
("TEXT_DELIVERYNOTE", TextDeliveryNote),
|
("TEXT_DELIVERYNOTE", TextDeliveryNote),
|
||||||
("TEXT_DELIVERYCONFIRMATION", TextDeliveryConfirmation),
|
("TEXT_DELIVERYCONFIRMATION", TextDeliveryConfirmation),
|
||||||
|
("TEXT_CREDITNOTE", TextCreditNote),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,13 @@ using Elwig.Models.Dtos;
|
|||||||
using Elwig.Models.Entities;
|
using Elwig.Models.Entities;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Elwig.Helpers.Export {
|
namespace Elwig.Helpers.Export {
|
||||||
public class Ebics(PaymentVar variant, string filename) : IBankingExporter {
|
public class Ebics(PaymentVar variant, string filename, int version) : IBankingExporter {
|
||||||
|
|
||||||
public static string FileExtension => "xml";
|
public static string FileExtension => "xml";
|
||||||
|
|
||||||
@@ -16,6 +17,7 @@ namespace Elwig.Helpers.Export {
|
|||||||
private readonly int Year = variant.Year;
|
private readonly int Year = variant.Year;
|
||||||
private readonly string Name = variant.Name;
|
private readonly string Name = variant.Name;
|
||||||
private readonly int AvNr = variant.AvNr;
|
private readonly int AvNr = variant.AvNr;
|
||||||
|
private readonly int Version = version;
|
||||||
|
|
||||||
public void Dispose() {
|
public void Dispose() {
|
||||||
GC.SuppressFinalize(this);
|
GC.SuppressFinalize(this);
|
||||||
@@ -32,6 +34,8 @@ namespace Elwig.Helpers.Export {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public async Task ExportAsync(IEnumerable<Transaction> transactions, IProgress<double>? progress = null) {
|
public async Task ExportAsync(IEnumerable<Transaction> transactions, IProgress<double>? progress = null) {
|
||||||
|
if (transactions.Any(tx => tx.Amount < 0))
|
||||||
|
throw new ArgumentException("Tranaction amount may not be negative");
|
||||||
progress?.Report(0.0);
|
progress?.Report(0.0);
|
||||||
var nbOfTxs = transactions.Count();
|
var nbOfTxs = transactions.Count();
|
||||||
int count = nbOfTxs + 2, i = 0;
|
int count = nbOfTxs + 2, i = 0;
|
||||||
@@ -41,9 +45,7 @@ namespace Elwig.Helpers.Export {
|
|||||||
|
|
||||||
await Writer.WriteLineAsync($"""
|
await Writer.WriteLineAsync($"""
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09"
|
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.{Version:00}">
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
||||||
xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.001.001.09 pain.001.001.09.xsd">
|
|
||||||
<CstmrCdtTrfInitn>
|
<CstmrCdtTrfInitn>
|
||||||
<GrpHdr>
|
<GrpHdr>
|
||||||
<MsgId>{msgId}</MsgId>
|
<MsgId>{msgId}</MsgId>
|
||||||
@@ -57,10 +59,10 @@ namespace Elwig.Helpers.Export {
|
|||||||
<PmtMtd>TRF</PmtMtd>
|
<PmtMtd>TRF</PmtMtd>
|
||||||
<NbOfTxs>{nbOfTxs}</NbOfTxs>
|
<NbOfTxs>{nbOfTxs}</NbOfTxs>
|
||||||
<CtrlSum>{Transaction.FormatAmount(ctrlSum)}</CtrlSum>
|
<CtrlSum>{Transaction.FormatAmount(ctrlSum)}</CtrlSum>
|
||||||
<ReqdExctnDt><Dt>{Date:yyyy-MM-dd}</Dt></ReqdExctnDt>
|
<ReqdExctnDt>{(Version >= 8 ? "<Dt>" : "")}{Date:yyyy-MM-dd}{(Version >= 8 ? "</Dt>" : "")}</ReqdExctnDt>
|
||||||
<Dbtr><Nm>{App.Client.NameFull}</Nm></Dbtr>
|
<Dbtr><Nm>{App.Client.NameFull}</Nm></Dbtr>
|
||||||
<DbtrAcct><Id><IBAN>{App.Client.Iban?.Replace(" ", "")}</IBAN></Id></DbtrAcct>
|
<DbtrAcct><Id><IBAN>{App.Client.Iban!.Replace(" ", "")}</IBAN></Id></DbtrAcct>
|
||||||
<DbtrAgt><FinInstnId><BICFI>{App.Client.Bic ?? "NOTPROVIDED"}</BICFI></FinInstnId></DbtrAgt>
|
<DbtrAgt><FinInstnId>{(Version >= 4 ? "<BICFI>" : "<BIC>")}{App.Client.Bic ?? "NOTPROVIDED"}{(Version >= 4 ? "</BICFI>" : "</BIC>")}</FinInstnId></DbtrAgt>
|
||||||
""");
|
""");
|
||||||
progress?.Report(100.0 * ++i / count);
|
progress?.Report(100.0 * ++i / count);
|
||||||
|
|
||||||
@@ -74,15 +76,14 @@ namespace Elwig.Helpers.Export {
|
|||||||
<PmtId><EndToEndId>{id}</EndToEndId></PmtId>
|
<PmtId><EndToEndId>{id}</EndToEndId></PmtId>
|
||||||
<Amt><InstdAmt Ccy="{tx.Currency}">{Transaction.FormatAmount(tx.Amount)}</InstdAmt></Amt>
|
<Amt><InstdAmt Ccy="{tx.Currency}">{Transaction.FormatAmount(tx.Amount)}</InstdAmt></Amt>
|
||||||
<Cdtr>
|
<Cdtr>
|
||||||
<Nm>{a.Name}</Nm>
|
<Nm>{a.Name[..Math.Min(140, a.Name.Length)]}</Nm>
|
||||||
<PstlAdr>
|
<PstlAdr>
|
||||||
<StrtNm>{a1}</StrtNm><BldgNb>{a2}</BldgNb>
|
<StrtNm>{a1?[..Math.Min(70, a1.Length)]}</StrtNm><BldgNb>{a2?[..Math.Min(16, a2.Length)]}</BldgNb>
|
||||||
<PstCd>{a.PostalDest.AtPlz?.Plz}</PstCd><TwnNm>{a.PostalDest.AtPlz?.Ort.Name}</TwnNm>
|
<PstCd>{a.PostalDest.AtPlz?.Plz}</PstCd><TwnNm>{a.PostalDest.AtPlz?.Ort.Name}</TwnNm>
|
||||||
<Ctry>{a.PostalDest.Country.Alpha2}</Ctry>
|
<Ctry>{a.PostalDest.Country.Alpha2}</Ctry>
|
||||||
</PstlAdr>
|
</PstlAdr>
|
||||||
</Cdtr>
|
</Cdtr>
|
||||||
<CdtrAcct><Id><IBAN>{tx.Member.Iban}</IBAN></Id></CdtrAcct>
|
<CdtrAcct><Id><IBAN>{tx.Member.Iban!}</IBAN></Id></CdtrAcct>
|
||||||
<CdtrAgt><FinInstnId><BICFI>{tx.Member.Bic ?? "NOTPROVIDED"}</BICFI></FinInstnId></CdtrAgt>
|
|
||||||
<RmtInf><Ustrd>{info}</Ustrd></RmtInf>
|
<RmtInf><Ustrd>{info}</Ustrd></RmtInf>
|
||||||
</CdtTrfTxInf>
|
</CdtTrfTxInf>
|
||||||
""");
|
""");
|
||||||
|
|||||||
@@ -108,19 +108,19 @@ namespace Elwig.Helpers.Export {
|
|||||||
<style:paragraph-properties fo:text-align="center"/>
|
<style:paragraph-properties fo:text-align="center"/>
|
||||||
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
|
<style:text-properties fo:font-weight="bold" style:font-weight-asian="bold" style:font-weight-complex="bold"/>
|
||||||
</style:style>
|
</style:style>
|
||||||
<number:number-style style:name="NN0"><number:number number:decimal-places="0" number:min-decimal-places="0" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN0"><number:number number:decimal-places="0" number:min-decimal-places="0" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N0" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN0"/>
|
<style:style style:name="N0" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN0"/>
|
||||||
<number:number-style style:name="NN1"><number:number number:decimal-places="1" number:min-decimal-places="1" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN1"><number:number number:decimal-places="1" number:min-decimal-places="1" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N1" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN1"/>
|
<style:style style:name="N1" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN1"/>
|
||||||
<number:number-style style:name="NN2"><number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN2"><number:number number:decimal-places="2" number:min-decimal-places="2" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N2" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN2"/>
|
<style:style style:name="N2" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN2"/>
|
||||||
<number:number-style style:name="NN3"><number:number number:decimal-places="3" number:min-decimal-places="3" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN3"><number:number number:decimal-places="3" number:min-decimal-places="3" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N3" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN3"/>
|
<style:style style:name="N3" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN3"/>
|
||||||
<number:number-style style:name="NN4"><number:number number:decimal-places="4" number:min-decimal-places="4" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN4"><number:number number:decimal-places="4" number:min-decimal-places="4" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N4" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN4"/>
|
<style:style style:name="N4" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN4"/>
|
||||||
<number:number-style style:name="NN5"><number:number number:decimal-places="5" number:min-decimal-places="5" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN5"><number:number number:decimal-places="5" number:min-decimal-places="5" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N5" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN5"/>
|
<style:style style:name="N5" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN5"/>
|
||||||
<number:number-style style:name="NN6"><number:number number:decimal-places="6" number:min-decimal-places="6" number:min-integer-digits="1"/></number:number-style>
|
<number:number-style style:name="NN6"><number:number number:decimal-places="6" number:min-decimal-places="6" number:min-integer-digits="1" number:grouping="true"/></number:number-style>
|
||||||
<style:style style:name="N6" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN6"/>
|
<style:style style:name="N6" style:family="table-cell" style:parent-style-name="default" style:data-style-name="NN6"/>
|
||||||
</office:automatic-styles>
|
</office:automatic-styles>
|
||||||
<office:body>
|
<office:body>
|
||||||
@@ -262,13 +262,14 @@ namespace Elwig.Helpers.Export {
|
|||||||
string c;
|
string c;
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
c = $"<{ct}{add}/>";
|
c = $"<{ct}{add}/>";
|
||||||
} else if (data is float || data is double || data is byte || data is char ||
|
} else if (data is decimal || data is float || data is double || data is byte || data is char ||
|
||||||
data is short || data is ushort || data is int || data is uint || data is long || data is ulong) {
|
data is short || data is ushort || data is int || data is uint || data is long || data is ulong) {
|
||||||
double v = double.Parse(data?.ToString() ?? "0"); // use default culture for ToString and Parse()!
|
double v = double.Parse(data?.ToString() ?? "0"); // use default culture for ToString and Parse()!
|
||||||
if (units != null && units.Length > 0) {
|
if (units != null && units.Length > 0) {
|
||||||
int n = -1;
|
int n = -1;
|
||||||
switch (units[0]) {
|
switch (units[0]) {
|
||||||
case "%": n = 1; data = $"{v:N1}"; break;
|
case "%": n = 1; data = $"{v:N1}"; break;
|
||||||
|
case "€": n = 2; data = $"{v:N2}"; break;
|
||||||
case "°KMW": n = 1; data = $"{v:N1}"; break;
|
case "°KMW": n = 1; data = $"{v:N1}"; break;
|
||||||
case "°Oe": n = 0; data = $"{v:N0}"; break;
|
case "°Oe": n = 0; data = $"{v:N0}"; break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,12 +74,16 @@ namespace Elwig.Helpers.Printing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static async Task Print(string path, int copies = 1) {
|
public static async Task Print(string path, int copies = 1) {
|
||||||
var p = new Process() { StartInfo = new() { FileName = PdfToPrinter } };
|
try {
|
||||||
p.StartInfo.ArgumentList.Add(path);
|
var p = new Process() { StartInfo = new() { FileName = PdfToPrinter } };
|
||||||
p.StartInfo.ArgumentList.Add("/s");
|
p.StartInfo.ArgumentList.Add(path);
|
||||||
p.StartInfo.ArgumentList.Add($"copies={copies}");
|
p.StartInfo.ArgumentList.Add("/s");
|
||||||
p.Start();
|
p.StartInfo.ArgumentList.Add($"copies={copies}");
|
||||||
await p.WaitForExitAsync();
|
p.Start();
|
||||||
|
await p.WaitForExitAsync();
|
||||||
|
} catch (Exception e) {
|
||||||
|
MessageBox.Show("Beim Drucken ist ein Fehler aufgetreten:\n\n" + e.Message, "Fehler beim Drucken");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-1
@@ -12,6 +12,8 @@ using System.Text;
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using Elwig.Models.Entities;
|
using Elwig.Models.Entities;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using ScottPlot.TickGenerators.TimeUnits;
|
||||||
|
using Elwig.Helpers.Billing;
|
||||||
|
|
||||||
namespace Elwig.Helpers {
|
namespace Elwig.Helpers {
|
||||||
public static partial class Utils {
|
public static partial class Utils {
|
||||||
@@ -161,7 +163,7 @@ namespace Elwig.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static string FormatIban(string iban) {
|
public static string FormatIban(string iban) {
|
||||||
return Regex.Replace(iban, ".{4}", "$0 ");
|
return Regex.Replace(iban.Trim(), ".{4}", "$0 ").Trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void RunBackground(string title, Func<Task> a) {
|
public static void RunBackground(string title, Func<Task> a) {
|
||||||
@@ -359,5 +361,23 @@ namespace Elwig.Helpers {
|
|||||||
}
|
}
|
||||||
return output.OrderByDescending(l => l.Count());
|
return output.OrderByDescending(l => l.Count());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<string> GetVaributes(AppDbContext ctx, int year, bool withSlash = false, bool onlyDelivered = true) {
|
||||||
|
var varieties = ctx.WineVarieties.Select(v => v.SortId).ToList();
|
||||||
|
var delivered = ctx.DeliveryParts
|
||||||
|
.Where(d => d.Year == year)
|
||||||
|
.Select(d => $"{d.SortId}{(withSlash ? "/" : "")}{d.AttrId}")
|
||||||
|
.Distinct()
|
||||||
|
.ToList();
|
||||||
|
return [.. (onlyDelivered ? delivered : delivered.Union(varieties)).Order()];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<Varibute> GetVaributeList(AppDbContext ctx, int year, bool onlyDelivered = true) {
|
||||||
|
var varieties = ctx.WineVarieties.ToDictionary(v => v.SortId, v => v);
|
||||||
|
var attributes = ctx.WineAttributes.ToDictionary(a => a.AttrId, a => a);
|
||||||
|
return GetVaributes(ctx, year, false, onlyDelivered)
|
||||||
|
.Select(s => new Varibute(varieties[s[..2]], s.Length > 2 ? attributes[s[2..]] : null))
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -8,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Elwig.Models.Dtos {
|
namespace Elwig.Models.Dtos {
|
||||||
public class AreaComUnderDeliveryData : DataTable<AreaComUnderDeliveryRow> {
|
public class AreaComUnderDeliveryData : DataTable<AreaComUnderDeliveryRow> {
|
||||||
|
|
||||||
private static readonly (string, string, string?, int)[] FieldNames = new[] {
|
private static readonly (string, string, string?, int)[] FieldNames = [
|
||||||
("MgNr", "MgNr.", null, 12),
|
("MgNr", "MgNr.", null, 12),
|
||||||
("Name", "Name", null, 40),
|
("Name", "Name", null, 40),
|
||||||
("GivenName", "Vorname", null, 40),
|
("GivenName", "Vorname", null, 40),
|
||||||
@@ -20,7 +19,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
("DeliveryObligations", "Lieferpflicht", "kg", 22),
|
("DeliveryObligations", "Lieferpflicht", "kg", 22),
|
||||||
("Weights", "Geliefert", "kg", 22),
|
("Weights", "Geliefert", "kg", 22),
|
||||||
("UnderDeliveries", "Unterliefert", "kg|%", 34),
|
("UnderDeliveries", "Unterliefert", "kg|%", 34),
|
||||||
};
|
];
|
||||||
|
|
||||||
public AreaComUnderDeliveryData(IEnumerable<AreaComUnderDeliveryRow> rows, int year) :
|
public AreaComUnderDeliveryData(IEnumerable<AreaComUnderDeliveryRow> rows, int year) :
|
||||||
base($"Unterlieferungen FB", $"Unterlieferungen laut Flächenbindungen {year}", rows, FieldNames) {
|
base($"Unterlieferungen FB", $"Unterlieferungen laut Flächenbindungen {year}", rows, FieldNames) {
|
||||||
|
|||||||
+147
-129
@@ -1,162 +1,180 @@
|
|||||||
using Elwig.Helpers;
|
using Elwig.Helpers;
|
||||||
using Elwig.Helpers.Billing;
|
using Elwig.Helpers.Billing;
|
||||||
using Elwig.Models.Entities;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Data.Entity.Core.Common.CommandTrees.ExpressionBuilder;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Elwig.Models.Dtos {
|
namespace Elwig.Models.Dtos {
|
||||||
public class CreditNoteData : DataTable<CreditNoteRow> {
|
public class CreditNoteData : DataTable<CreditNoteRow> {
|
||||||
|
|
||||||
private static readonly (string, string, string?)[] FieldNames = new[] {
|
private static readonly (string, string, string?, int)[] FieldNames = [
|
||||||
("", "", (string?)null), // TODO
|
("MgNr", "MgNr.", null, 12),
|
||||||
};
|
("Name", "Name", null, 40),
|
||||||
|
("GivenName", "Vorname", null, 40),
|
||||||
|
("Address", "Adresse", null, 60),
|
||||||
|
("Plz", "PLZ", null, 10),
|
||||||
|
("Locality", "Ort", null, 60),
|
||||||
|
("Iban", "IBAN", null, 45),
|
||||||
|
("TgNr", "TG-Nr.", null, 20),
|
||||||
|
("Sum", "Zwischens.", "€", 20),
|
||||||
|
("Surcharge", "Zuschlag", "€", 20),
|
||||||
|
("Total", "Gesamt", "€", 20),
|
||||||
|
("ConsideredSum", "Berückstgt.", "€", 20),
|
||||||
|
("Net", "Netto", "€", 20),
|
||||||
|
("Vat1", "10% MwSt.", "€", 20),
|
||||||
|
("Vat2", "13% MwSt.", "€", 20),
|
||||||
|
("Gross", "Brutto", "€", 20),
|
||||||
|
("Penalties", "Pönalen FB", "€", 20),
|
||||||
|
("Penalty", "Unterl. GA", "€", 20),
|
||||||
|
("AutoBs", "GA Nachz.", "€", 20),
|
||||||
|
("Others", "Sonstige", "€", 20),
|
||||||
|
("Considered", "Berückstgt.", "€", 20),
|
||||||
|
("Amount", "Betrag", "€", 20),
|
||||||
|
];
|
||||||
|
|
||||||
private readonly int Year;
|
public CreditNoteData(IEnumerable<CreditNoteRow> rows, int year, string name) :
|
||||||
private readonly int? TgNr;
|
base($"Buchungsliste", $"Buchungsliste {name} {year}", rows, FieldNames) {
|
||||||
private readonly int? AvNr;
|
|
||||||
private readonly int? MgNr;
|
|
||||||
|
|
||||||
private CreditNoteData(IEnumerable<CreditNoteRow> rows, int year, int? tgnr, int? avnr = null, int? mgnr = null) :
|
|
||||||
base($"Traubengutschrift {year}/{tgnr}", rows, FieldNames) {
|
|
||||||
Year = year;
|
|
||||||
TgNr = tgnr;
|
|
||||||
AvNr = avnr;
|
|
||||||
MgNr = mgnr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<IDictionary<int, CreditNoteData>> ForPaymentVariant(DbSet<CreditNoteRowSingle> table, DbSet<Season> seasons, int year, int avnr) {
|
public static async Task<CreditNoteData> ForPaymentVariant(AppDbContext ctx, int year, int avnr) {
|
||||||
return (await FromDbSet(table, year, avnr))
|
var variant = await ctx.PaymentVariants.FindAsync(year, avnr);
|
||||||
.GroupBy(
|
var name = variant!.Name;
|
||||||
r => new { r.Year, r.AvNr, r.MgNr, r.TgNr, r.DId, r.DPNr },
|
var data = BillingData.FromJson(variant!.Data);
|
||||||
(k, g) => new CreditNoteRow(g, seasons))
|
var rows = (await FromDbSet(ctx.CreditNoteRows, year, avnr)).Select(r => new CreditNoteRow(r, data)).ToList();
|
||||||
.GroupBy(
|
return new CreditNoteData(rows, year, name);
|
||||||
r => new { r.Year, r.AvNr, r.MgNr, r.TgNr },
|
|
||||||
(k, g) => new CreditNoteData(g, k.Year, k.TgNr, mgnr: k.MgNr))
|
|
||||||
.ToDictionary(d => d.MgNr ?? 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<IEnumerable<CreditNoteRowSingle>> FromDbSet(DbSet<CreditNoteRowSingle> table, int? year = null, int? avnr = null, int? mgnr = null) {
|
private static async Task<IEnumerable<CreditNoteRowSingle>> FromDbSet(DbSet<CreditNoteRowSingle> table, int year, int avnr) {
|
||||||
var y = year?.ToString() ?? "NULL";
|
return await table.FromSql($"""
|
||||||
var v = avnr?.ToString() ?? "NULL";
|
SELECT m.mgnr, m.family_name, m.given_name, p.plz, o.name AS ort, m.address, m.iban, c.tgnr, s.year, s.precision,
|
||||||
var m = mgnr?.ToString() ?? "NULL";
|
p.amount - p.net_amount AS surcharge,
|
||||||
return await table.FromSqlRaw($"""
|
c.net_amount, c.prev_net_amount, c.vat, c.vat_amount, c.gross_amount, c.modifiers, c.prev_modifiers, c.amount,
|
||||||
SELECT d.year, c.tgnr, v.avnr, d.mgnr, d.did, d.lsnr, d.dpnr, d.weight, d.modifiers,
|
ROUND(COALESCE(u.total_penalty, 0) / POW(10, 4 - 2)) AS fb_penalty,
|
||||||
b.bktnr, d.sortid, b.discr, b.value, pb.price, pb.amount, p.net_amount, p.amount AS total_amount,
|
ROUND(COALESCE(b.total_penalty, 0) / POW(10, s.precision - 2)) AS bs_penalty,
|
||||||
s.name AS variant, a.name AS attribute, q.name AS quality_level, d.oe, d.kmw
|
ROUND(COALESCE(a.total_amount, 0) / POW(10, s.precision - 2)) AS auto_bs
|
||||||
FROM v_delivery d
|
FROM credit c
|
||||||
JOIN wine_variety s ON s.sortid = d.sortid
|
LEFT JOIN member m ON m.mgnr = c.mgnr
|
||||||
LEFT JOIN wine_attribute a ON a.attrid = d.attrid
|
LEFT JOIN payment_member p ON (p.year, p.avnr, p.mgnr) = (c.year, c.avnr, c.mgnr)
|
||||||
JOIN wine_quality_level q ON q.qualid = d.qualid
|
LEFT JOIN AT_plz_dest p ON p.id = m.postal_dest
|
||||||
LEFT JOIN delivery_part_bucket b ON (b.year, b.did, b.dpnr) = (d.year, d.did, d.dpnr)
|
LEFT JOIN AT_ort o ON o.okz = p.okz
|
||||||
LEFT JOIN payment_variant v ON v.year = d.year
|
LEFT JOIN season s ON s.year = c.year
|
||||||
LEFT JOIN payment_delivery_part p ON (p.year, p.did, p.dpnr, p.avnr) = (d.year, d.did, d.dpnr, v.avnr)
|
LEFT JOIN v_penalty_area_commitments u ON (u.year, u.mgnr) = (s.year, m.mgnr)
|
||||||
LEFT JOIN payment_delivery_part_bucket pb ON (pb.year, pb.did, pb.dpnr, pb.bktnr, pb.avnr) = (b.year, b.did, b.dpnr, b.bktnr, v.avnr)
|
LEFT JOIN v_penalty_business_shares b ON (b.year, b.mgnr) = (s.year, m.mgnr)
|
||||||
LEFT JOIN credit c ON (c.year, c.avnr, c.mgnr) = (d.year, v.avnr, d.mgnr)
|
LEFT JOIN v_auto_business_shares a ON (a.year, a.mgnr) = (s.year, m.mgnr)
|
||||||
WHERE b.value > 0 AND (d.year = {y} OR {y} IS NULL) AND (v.avnr = {v} OR {v} IS NULL) AND (d.mgnr = {m} OR {m} IS NULL)
|
WHERE c.year = {year} AND c.avnr = {avnr}
|
||||||
ORDER BY d.year, v.avnr, d.mgnr, d.lsnr, d.dpnr
|
ORDER BY m.mgnr
|
||||||
""").ToListAsync();
|
""").ToListAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CreditNoteRow {
|
public class CreditNoteRow {
|
||||||
|
|
||||||
public int Year;
|
|
||||||
public int? TgNr;
|
|
||||||
public int AvNr;
|
|
||||||
public int MgNr;
|
public int MgNr;
|
||||||
|
public string Name;
|
||||||
|
public string GivenName;
|
||||||
|
public string Address;
|
||||||
|
public int Plz;
|
||||||
|
public string Locality;
|
||||||
|
public string Iban;
|
||||||
|
public string TgNr;
|
||||||
|
public decimal Sum;
|
||||||
|
public decimal? Surcharge;
|
||||||
|
public decimal Total;
|
||||||
|
public decimal? ConsideredSum;
|
||||||
|
public decimal Net;
|
||||||
|
public decimal? Vat1, Vat2;
|
||||||
|
public decimal Gross;
|
||||||
|
public decimal? Penalties;
|
||||||
|
public decimal? Penalty;
|
||||||
|
public decimal? AutoBs;
|
||||||
|
public decimal? Others;
|
||||||
|
public decimal? Considered;
|
||||||
|
public decimal Amount;
|
||||||
|
|
||||||
public string LsNr;
|
public CreditNoteRow(CreditNoteRowSingle row, BillingData data) {
|
||||||
public int DPNr;
|
byte prec1 = 2, prec2 = row.Precision;
|
||||||
public string Variant;
|
MgNr = row.MgNr;
|
||||||
public string? Attribute;
|
Name = row.Name;
|
||||||
public string[] Modifiers;
|
GivenName = row.GivenName;
|
||||||
public string QualityLevel;
|
Address = row.Address;
|
||||||
public (double Oe, double Kmw) Gradation;
|
Plz = row.Plz;
|
||||||
public (string Name, int Value, decimal? Price, decimal? Amount)[] Buckets;
|
Locality = row.Locality;
|
||||||
public decimal? TotalModifiers;
|
Iban = Utils.FormatIban(row.Iban);
|
||||||
public decimal? Amount;
|
TgNr = $"{row.Year}/{row.TgNr}";
|
||||||
|
Total = Utils.DecFromDb(row.NetAmount, prec1);
|
||||||
public CreditNoteRow(IEnumerable<CreditNoteRowSingle> rows, DbSet<Season> seasons) {
|
Surcharge = (row.Surcharge == null || row.Surcharge == 0) ? null : Utils.DecFromDb((long)row.Surcharge, prec2);
|
||||||
var f = rows.First();
|
Sum = Total - (Surcharge ?? 0);
|
||||||
Year = f.Year;
|
ConsideredSum = (row.PrevNetAmount == null ||row.PrevNetAmount == 0) ? null : -Utils.DecFromDb((long)row.PrevNetAmount, prec1);
|
||||||
TgNr = f.TgNr;
|
Net = Total + (ConsideredSum ?? 0);
|
||||||
MgNr = f.MgNr;
|
if (row.Vat == 0.10) {
|
||||||
var season = seasons.Find(Year);
|
Vat1 = Utils.DecFromDb(row.VatAmount, prec1);
|
||||||
|
} else if (row.Vat == 0.13) {
|
||||||
LsNr = f.LsNr;
|
Vat2 = Utils.DecFromDb(row.VatAmount, prec1);
|
||||||
DPNr = f.DPNr;
|
}
|
||||||
Variant = f.Variant;
|
decimal mod = (row.Modifiers == null) ? 0 : Utils.DecFromDb((long)row.Modifiers, prec1);
|
||||||
Attribute = f.Attribute;
|
if (data.ConsiderContractPenalties)
|
||||||
var modifiers = (IEnumerable<Modifier>)(f.Modifiers ?? "").Split(',')
|
Penalties = (row.FbPenalty == null || row.FbPenalty == 0) ? null : Utils.DecFromDb((long)row.FbPenalty, prec1);
|
||||||
.Select(m => season?.Modifiers.FirstOrDefault(s => s.ModId == m))
|
if (data.ConsiderTotalPenalty)
|
||||||
.Where(m => m != null)
|
Penalty = (row.BsPealty == null || row.BsPealty == 0) ? null : Utils.DecFromDb((long)row.BsPealty, prec1);
|
||||||
.OrderBy(m => m.Ordering)
|
if (data.ConsiderAutoBusinessShares)
|
||||||
.ToList();
|
AutoBs = (row.AutoBs == null || row.AutoBs == 0) ? null : -Utils.DecFromDb((long)row.AutoBs, prec1);
|
||||||
Modifiers = modifiers.Select(m => m.Name).ToArray();
|
mod -= (Penalties ?? 0) + (Penalty ?? 0) + (AutoBs ?? 0);
|
||||||
QualityLevel = f.QualityLevel;
|
Others = (mod == 0) ? null : mod;
|
||||||
Gradation = (f.Oe, f.Kmw);
|
Gross = Utils.DecFromDb(row.GrossAmount, prec1);
|
||||||
Buckets = rows
|
Considered = (row.PrevModifiers == null || row.PrevModifiers == 0) ? null : -Utils.DecFromDb((long)row.PrevModifiers, prec1);
|
||||||
.Where(b => b.Value > 0)
|
Amount = Utils.DecFromDb(row.Amount, prec1);
|
||||||
.OrderByDescending(b => b.BktNr)
|
|
||||||
.Select(b => (b.Discr == "_" ? "ungeb." : $"geb. {f.SortId}{b.Discr}", b.Value,
|
|
||||||
b.Price != null ? season?.DecFromDb((long)b.Price) : null,
|
|
||||||
b.Amount != null ? season?.DecFromDb((long)b.Amount) : null))
|
|
||||||
.ToArray();
|
|
||||||
Amount = f.TotalAmount != null ? season?.DecFromDb((long)f.TotalAmount) : null;
|
|
||||||
var netAmount = f.NetAmount != null ? season?.DecFromDb((long)f.NetAmount) : null;
|
|
||||||
TotalModifiers = Amount - netAmount;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[Keyless]
|
[Keyless]
|
||||||
public class CreditNoteRowSingle {
|
public class CreditNoteRowSingle {
|
||||||
[Column("year")]
|
|
||||||
public int Year { get; set; }
|
|
||||||
[Column("tgnr")]
|
|
||||||
public int? TgNr { get; set; }
|
|
||||||
[Column("avnr")]
|
|
||||||
public int? AvNr { get; set; }
|
|
||||||
[Column("mgnr")]
|
[Column("mgnr")]
|
||||||
public int MgNr { get; set; }
|
public int MgNr { get; set; }
|
||||||
[Column("did")]
|
[Column("family_name")]
|
||||||
public int DId { get; set; }
|
public string Name { get; set; }
|
||||||
[Column("lsnr")]
|
[Column("given_name")]
|
||||||
public string LsNr { get; set; }
|
public string GivenName { get; set; }
|
||||||
[Column("dpnr")]
|
[Column("address")]
|
||||||
public int DPNr { get; set; }
|
public string Address { get; set; }
|
||||||
[Column("weight")]
|
[Column("plz")]
|
||||||
public int Weight { get; set; }
|
public int Plz { get; set; }
|
||||||
[Column("modifiers")]
|
[Column("ort")]
|
||||||
public string? Modifiers { get; set; }
|
public string LocalityFull { get; set; }
|
||||||
[Column("bktnr")]
|
[NotMapped]
|
||||||
public int BktNr { get; set; }
|
public string Locality => LocalityFull.Split(",")[0];
|
||||||
[Column("sortid")]
|
[Column("iban")]
|
||||||
public string SortId { get; set; }
|
public string Iban { get; set; }
|
||||||
[Column("discr")]
|
[Column("year")]
|
||||||
public string Discr { get; set; }
|
public int Year { get; set; }
|
||||||
[Column("value")]
|
[Column("precision")]
|
||||||
public int Value { get; set; }
|
public byte Precision { get; set; }
|
||||||
[Column("price")]
|
[Column("tgnr")]
|
||||||
public long? Price { get; set; }
|
public string TgNr { get; set; }
|
||||||
[Column("amount")]
|
[Column("surcharge")]
|
||||||
public long? Amount { get; set; }
|
public long? Surcharge { get; set; }
|
||||||
[Column("net_amount")]
|
[Column("net_amount")]
|
||||||
public long? NetAmount { get; set; }
|
public long NetAmount { get; set; }
|
||||||
[Column("total_amount")]
|
[Column("prev_net_amount")]
|
||||||
public long? TotalAmount { get; set; }
|
public long? PrevNetAmount { get; set; }
|
||||||
[Column("variant")]
|
[Column("vat")]
|
||||||
public string Variant { get; set; }
|
public double Vat { get; set; }
|
||||||
[Column("attribute")]
|
[Column("vat_amount")]
|
||||||
public string? Attribute { get; set; }
|
public long VatAmount { get; set; }
|
||||||
[Column("quality_level")]
|
[Column("gross_amount")]
|
||||||
public string QualityLevel { get; set; }
|
public long GrossAmount { get; set; }
|
||||||
[Column("oe")]
|
[Column("modifiers")]
|
||||||
public double Oe { get; set; }
|
public long? Modifiers { get; set; }
|
||||||
[Column("kmw")]
|
[Column("prev_modifiers")]
|
||||||
public double Kmw { get; set; }
|
public long? PrevModifiers { get; set; }
|
||||||
|
[Column("amount")]
|
||||||
|
public long Amount { get; set; }
|
||||||
|
[Column("fb_penalty")]
|
||||||
|
public long? FbPenalty { get; set; }
|
||||||
|
[Column("bs_penalty")]
|
||||||
|
public long? BsPealty { get; set; }
|
||||||
|
[Column("auto_bs")]
|
||||||
|
public long? AutoBs { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,159 @@
|
|||||||
|
using Elwig.Models.Entities;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Elwig.Models.Dtos {
|
||||||
|
public class CreditNoteDeliveryData : DataTable<CreditNoteDeliveryRow> {
|
||||||
|
|
||||||
|
private static readonly (string, string, string?)[] FieldNames = [
|
||||||
|
("", "", null), // TODO
|
||||||
|
];
|
||||||
|
|
||||||
|
private readonly int Year;
|
||||||
|
private readonly int? TgNr;
|
||||||
|
private readonly int? AvNr;
|
||||||
|
private readonly int? MgNr;
|
||||||
|
|
||||||
|
private CreditNoteDeliveryData(IEnumerable<CreditNoteDeliveryRow> rows, int year, int? tgnr, int? avnr = null, int? mgnr = null) :
|
||||||
|
base($"Traubengutschrift {year}/{tgnr}", rows, FieldNames) {
|
||||||
|
Year = year;
|
||||||
|
TgNr = tgnr;
|
||||||
|
AvNr = avnr;
|
||||||
|
MgNr = mgnr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static async Task<IDictionary<int, CreditNoteDeliveryData>> ForPaymentVariant(DbSet<CreditNoteDeliveryRowSingle> table, DbSet<Season> seasons, int year, int avnr) {
|
||||||
|
return (await FromDbSet(table, year, avnr))
|
||||||
|
.GroupBy(
|
||||||
|
r => new { r.Year, r.AvNr, r.MgNr, r.TgNr, r.DId, r.DPNr },
|
||||||
|
(k, g) => new CreditNoteDeliveryRow(g, seasons))
|
||||||
|
.GroupBy(
|
||||||
|
r => new { r.Year, r.AvNr, r.MgNr, r.TgNr },
|
||||||
|
(k, g) => new CreditNoteDeliveryData(g, k.Year, k.TgNr, mgnr: k.MgNr))
|
||||||
|
.ToDictionary(d => d.MgNr ?? 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task<IEnumerable<CreditNoteDeliveryRowSingle>> FromDbSet(DbSet<CreditNoteDeliveryRowSingle> table, int? year = null, int? avnr = null, int? mgnr = null) {
|
||||||
|
var y = year?.ToString() ?? "NULL";
|
||||||
|
var v = avnr?.ToString() ?? "NULL";
|
||||||
|
var m = mgnr?.ToString() ?? "NULL";
|
||||||
|
return await table.FromSqlRaw($"""
|
||||||
|
SELECT d.year, c.tgnr, v.avnr, d.mgnr, d.did, d.lsnr, d.dpnr, d.weight, d.modifiers,
|
||||||
|
b.bktnr, d.sortid, b.discr, b.value, pb.price, pb.amount, p.net_amount, p.amount AS total_amount,
|
||||||
|
s.name AS variety, a.name AS attribute, q.name AS quality_level, d.oe, d.kmw
|
||||||
|
FROM v_delivery d
|
||||||
|
JOIN wine_variety s ON s.sortid = d.sortid
|
||||||
|
LEFT JOIN wine_attribute a ON a.attrid = d.attrid
|
||||||
|
JOIN wine_quality_level q ON q.qualid = d.qualid
|
||||||
|
LEFT JOIN delivery_part_bucket b ON (b.year, b.did, b.dpnr) = (d.year, d.did, d.dpnr)
|
||||||
|
LEFT JOIN payment_variant v ON v.year = d.year
|
||||||
|
LEFT JOIN payment_delivery_part p ON (p.year, p.did, p.dpnr, p.avnr) = (d.year, d.did, d.dpnr, v.avnr)
|
||||||
|
LEFT JOIN payment_delivery_part_bucket pb ON (pb.year, pb.did, pb.dpnr, pb.bktnr, pb.avnr) = (b.year, b.did, b.dpnr, b.bktnr, v.avnr)
|
||||||
|
LEFT JOIN credit c ON (c.year, c.avnr, c.mgnr) = (d.year, v.avnr, d.mgnr)
|
||||||
|
WHERE b.value > 0 AND (d.year = {y} OR {y} IS NULL) AND (v.avnr = {v} OR {v} IS NULL) AND (d.mgnr = {m} OR {m} IS NULL)
|
||||||
|
ORDER BY d.year, v.avnr, d.mgnr, d.lsnr, d.dpnr
|
||||||
|
""").ToListAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CreditNoteDeliveryRow {
|
||||||
|
|
||||||
|
public int Year;
|
||||||
|
public int? TgNr;
|
||||||
|
public int AvNr;
|
||||||
|
public int MgNr;
|
||||||
|
|
||||||
|
public string LsNr;
|
||||||
|
public int DPNr;
|
||||||
|
public string Variety;
|
||||||
|
public string? Attribute;
|
||||||
|
public string[] Modifiers;
|
||||||
|
public string QualityLevel;
|
||||||
|
public (double Oe, double Kmw) Gradation;
|
||||||
|
public (string Name, int Value, decimal? Price, decimal? Amount)[] Buckets;
|
||||||
|
public decimal? TotalModifiers;
|
||||||
|
public decimal? Amount;
|
||||||
|
|
||||||
|
public CreditNoteDeliveryRow(IEnumerable<CreditNoteDeliveryRowSingle> rows, DbSet<Season> seasons) {
|
||||||
|
var f = rows.First();
|
||||||
|
Year = f.Year;
|
||||||
|
TgNr = f.TgNr;
|
||||||
|
MgNr = f.MgNr;
|
||||||
|
var season = seasons.Find(Year);
|
||||||
|
|
||||||
|
LsNr = f.LsNr;
|
||||||
|
DPNr = f.DPNr;
|
||||||
|
Variety = f.Variety;
|
||||||
|
Attribute = f.Attribute;
|
||||||
|
var modifiers = (IEnumerable<Modifier>)(f.Modifiers ?? "").Split(',')
|
||||||
|
.Select(m => season?.Modifiers.FirstOrDefault(s => s.ModId == m))
|
||||||
|
.Where(m => m != null)
|
||||||
|
.OrderBy(m => m.Ordering)
|
||||||
|
.ToList();
|
||||||
|
Modifiers = modifiers.Select(m => m.Name).ToArray();
|
||||||
|
QualityLevel = f.QualityLevel;
|
||||||
|
Gradation = (f.Oe, f.Kmw);
|
||||||
|
Buckets = rows
|
||||||
|
.Where(b => b.Value > 0)
|
||||||
|
.OrderByDescending(b => b.BktNr)
|
||||||
|
.Select(b => (b.Discr == "_" ? "ungeb." : $"geb. {f.SortId}{b.Discr}", b.Value,
|
||||||
|
b.Price != null ? season?.DecFromDb((long)b.Price) : null,
|
||||||
|
b.Amount != null ? season?.DecFromDb((long)b.Amount) : null))
|
||||||
|
.ToArray();
|
||||||
|
Amount = f.TotalAmount != null ? season?.DecFromDb((long)f.TotalAmount) : null;
|
||||||
|
var netAmount = f.NetAmount != null ? season?.DecFromDb((long)f.NetAmount) : null;
|
||||||
|
TotalModifiers = Amount - netAmount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[Keyless]
|
||||||
|
public class CreditNoteDeliveryRowSingle {
|
||||||
|
[Column("year")]
|
||||||
|
public int Year { get; set; }
|
||||||
|
[Column("tgnr")]
|
||||||
|
public int? TgNr { get; set; }
|
||||||
|
[Column("avnr")]
|
||||||
|
public int? AvNr { get; set; }
|
||||||
|
[Column("mgnr")]
|
||||||
|
public int MgNr { get; set; }
|
||||||
|
[Column("did")]
|
||||||
|
public int DId { get; set; }
|
||||||
|
[Column("lsnr")]
|
||||||
|
public string LsNr { get; set; }
|
||||||
|
[Column("dpnr")]
|
||||||
|
public int DPNr { get; set; }
|
||||||
|
[Column("weight")]
|
||||||
|
public int Weight { get; set; }
|
||||||
|
[Column("modifiers")]
|
||||||
|
public string? Modifiers { get; set; }
|
||||||
|
[Column("bktnr")]
|
||||||
|
public int BktNr { get; set; }
|
||||||
|
[Column("sortid")]
|
||||||
|
public string SortId { get; set; }
|
||||||
|
[Column("discr")]
|
||||||
|
public string Discr { get; set; }
|
||||||
|
[Column("value")]
|
||||||
|
public int Value { get; set; }
|
||||||
|
[Column("price")]
|
||||||
|
public long? Price { get; set; }
|
||||||
|
[Column("amount")]
|
||||||
|
public long? Amount { get; set; }
|
||||||
|
[Column("net_amount")]
|
||||||
|
public long? NetAmount { get; set; }
|
||||||
|
[Column("total_amount")]
|
||||||
|
public long? TotalAmount { get; set; }
|
||||||
|
[Column("variety")]
|
||||||
|
public string Variety { get; set; }
|
||||||
|
[Column("attribute")]
|
||||||
|
public string? Attribute { get; set; }
|
||||||
|
[Column("quality_level")]
|
||||||
|
public string QualityLevel { get; set; }
|
||||||
|
[Column("oe")]
|
||||||
|
public double Oe { get; set; }
|
||||||
|
[Column("kmw")]
|
||||||
|
public double Kmw { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
-16
@@ -5,42 +5,42 @@ using System.Linq;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace Elwig.Models.Dtos {
|
namespace Elwig.Models.Dtos {
|
||||||
public class DeliveryConfirmationData : DataTable<DeliveryConfirmationRow> {
|
public class DeliveryConfirmationDeliveryData : DataTable<DeliveryConfirmationDeliveryRow> {
|
||||||
|
|
||||||
private static readonly (string, string, string?, int)[] FieldNames = new[] {
|
private static readonly (string, string, string?, int)[] FieldNames = [
|
||||||
("LsNr", "LsNr.", null, 26),
|
("LsNr", "LsNr.", null, 26),
|
||||||
("DPNr", "Pos.", null, 8),
|
("DPNr", "Pos.", null, 8),
|
||||||
("Variant", "Sorte", null, 40),
|
("Variety", "Sorte", null, 40),
|
||||||
("Attribute", "Attribut", null, 20),
|
("Attribute", "Attribut", null, 20),
|
||||||
("Modifiers", "Zu-/Abschläge", null, 30),
|
("Modifiers", "Zu-/Abschläge", null, 30),
|
||||||
("QualityLevel", "Qualitätsstufe", null, 25),
|
("QualityLevel", "Qualitätsstufe", null, 25),
|
||||||
("Gradation", "Gradation", "°Oe|°KMW", 32),
|
("Gradation", "Gradation", "°Oe|°KMW", 32),
|
||||||
("Buckets", "Flächenbindung", "|kg", 36),
|
("Buckets", "Flächenbindung", "|kg", 36),
|
||||||
("Weight", "Gewicht", "kg", 16),
|
("Weight", "Gewicht", "kg", 16),
|
||||||
};
|
];
|
||||||
|
|
||||||
private readonly int MgNr;
|
private readonly int MgNr;
|
||||||
|
|
||||||
private DeliveryConfirmationData(IEnumerable<DeliveryConfirmationRow> rows, int year, Member m) :
|
private DeliveryConfirmationDeliveryData(IEnumerable<DeliveryConfirmationDeliveryRow> rows, int year, Member m) :
|
||||||
base($"Anlieferungsbestätigung", $"Anlieferungsbestätigung {year} – {m.AdministrativeName}", rows, FieldNames) {
|
base($"Anlieferungsbestätigung", $"Anlieferungsbestätigung {year} – {m.AdministrativeName}", rows, FieldNames) {
|
||||||
MgNr = m.MgNr;
|
MgNr = m.MgNr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DeliveryConfirmationData CreateEmpty(int year, Member m) {
|
public static DeliveryConfirmationDeliveryData CreateEmpty(int year, Member m) {
|
||||||
return new([], year, m);
|
return new([], year, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<IDictionary<int, DeliveryConfirmationData>> ForSeason(DbSet<DeliveryPart> table, int year) {
|
public static async Task<IDictionary<int, DeliveryConfirmationDeliveryData>> ForSeason(DbSet<DeliveryPart> table, int year) {
|
||||||
return (await FromDbSet(table, year))
|
return (await FromDbSet(table, year))
|
||||||
.GroupBy(
|
.GroupBy(
|
||||||
p => p.Delivery.Member,
|
p => p.Delivery.Member,
|
||||||
p => new DeliveryConfirmationRow(p),
|
p => new DeliveryConfirmationDeliveryRow(p),
|
||||||
(k, g) => new DeliveryConfirmationData(g, year, k)
|
(k, g) => new DeliveryConfirmationDeliveryData(g, year, k)
|
||||||
).ToDictionary(d => d.MgNr, d => d);
|
).ToDictionary(d => d.MgNr, d => d);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static async Task<DeliveryConfirmationData> ForMember(DbSet<DeliveryPart> table, int year, Member m) {
|
public static async Task<DeliveryConfirmationDeliveryData> ForMember(DbSet<DeliveryPart> table, int year, Member m) {
|
||||||
return new DeliveryConfirmationData((await FromDbSet(table, year, m.MgNr)).Select(p => new DeliveryConfirmationRow(p)), year, m);
|
return new DeliveryConfirmationDeliveryData((await FromDbSet(table, year, m.MgNr)).Select(p => new DeliveryConfirmationDeliveryRow(p)), year, m);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static async Task<IEnumerable<DeliveryPart>> FromDbSet(DbSet<DeliveryPart> table, int? year = null, int? mgnr = null) {
|
private static async Task<IEnumerable<DeliveryPart>> FromDbSet(DbSet<DeliveryPart> table, int? year = null, int? mgnr = null) {
|
||||||
@@ -51,7 +51,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
if (mgnr != null) q = q.Where(p => p.Delivery.MgNr == mgnr);
|
if (mgnr != null) q = q.Where(p => p.Delivery.MgNr == mgnr);
|
||||||
await q
|
await q
|
||||||
.Include(p => p.Delivery)
|
.Include(p => p.Delivery)
|
||||||
.Include(p => p.Variant)
|
.Include(p => p.Variety)
|
||||||
.Include(p => p.Attribute)
|
.Include(p => p.Attribute)
|
||||||
.Include(p => p.Quality)
|
.Include(p => p.Quality)
|
||||||
.Include(p => p.Buckets)
|
.Include(p => p.Buckets)
|
||||||
@@ -68,10 +68,10 @@ namespace Elwig.Models.Dtos {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DeliveryConfirmationRow {
|
public class DeliveryConfirmationDeliveryRow {
|
||||||
public string LsNr;
|
public string LsNr;
|
||||||
public int DPNr;
|
public int DPNr;
|
||||||
public string Variant;
|
public string Variety;
|
||||||
public string? Attribute;
|
public string? Attribute;
|
||||||
public string QualityLevel;
|
public string QualityLevel;
|
||||||
public (double Oe, double Kmw) Gradation;
|
public (double Oe, double Kmw) Gradation;
|
||||||
@@ -79,11 +79,11 @@ namespace Elwig.Models.Dtos {
|
|||||||
public int Weight;
|
public int Weight;
|
||||||
public (string Name, int Value)[] Buckets;
|
public (string Name, int Value)[] Buckets;
|
||||||
|
|
||||||
public DeliveryConfirmationRow(DeliveryPart p) {
|
public DeliveryConfirmationDeliveryRow(DeliveryPart p) {
|
||||||
var d = p.Delivery;
|
var d = p.Delivery;
|
||||||
LsNr = d.LsNr;
|
LsNr = d.LsNr;
|
||||||
DPNr = p.DPNr;
|
DPNr = p.DPNr;
|
||||||
Variant = p.Variant.Name;
|
Variety = p.Variety.Name;
|
||||||
Attribute = p.Attribute?.Name;
|
Attribute = p.Attribute?.Name;
|
||||||
QualityLevel = p.Quality.Name;
|
QualityLevel = p.Quality.Name;
|
||||||
Gradation = (p.Oe, p.Kmw);
|
Gradation = (p.Oe, p.Kmw);
|
||||||
@@ -8,7 +8,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Elwig.Models.Dtos {
|
namespace Elwig.Models.Dtos {
|
||||||
public class MemberDeliveryPerVariantData : DataTable<MemberDeliveryPerVariantRow> {
|
public class MemberDeliveryPerVariantData : DataTable<MemberDeliveryPerVariantRow> {
|
||||||
|
|
||||||
private static readonly (string, string, string?, int)[] FieldNames = new[] {
|
private static readonly (string, string, string?, int)[] FieldNames = [
|
||||||
("MgNr", "MgNr.", null, 12),
|
("MgNr", "MgNr.", null, 12),
|
||||||
("Name", "Name", null, 40),
|
("Name", "Name", null, 40),
|
||||||
("GivenName", "Vorname", null, 40),
|
("GivenName", "Vorname", null, 40),
|
||||||
@@ -20,7 +20,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
("Weights", "Geliefert", "kg", 22),
|
("Weights", "Geliefert", "kg", 22),
|
||||||
("Areas", "Fläche", "m²", 22),
|
("Areas", "Fläche", "m²", 22),
|
||||||
("Yields", "Ertrag", "kg/ha", 22),
|
("Yields", "Ertrag", "kg/ha", 22),
|
||||||
};
|
];
|
||||||
|
|
||||||
|
|
||||||
public MemberDeliveryPerVariantData(IEnumerable<MemberDeliveryPerVariantRow> rows, int year) :
|
public MemberDeliveryPerVariantData(IEnumerable<MemberDeliveryPerVariantRow> rows, int year) :
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using System.Threading.Tasks;
|
|||||||
namespace Elwig.Models.Dtos {
|
namespace Elwig.Models.Dtos {
|
||||||
public class OverUnderDeliveryData : DataTable<OverUnderDeliveryRow> {
|
public class OverUnderDeliveryData : DataTable<OverUnderDeliveryRow> {
|
||||||
|
|
||||||
private static readonly (string, string, string?, int)[] FieldNames = new[] {
|
private static readonly (string, string, string?, int)[] FieldNames = [
|
||||||
("MgNr", "MgNr.", null, 12),
|
("MgNr", "MgNr.", null, 12),
|
||||||
("Name", "Name", null, 40),
|
("Name", "Name", null, 40),
|
||||||
("GivenName", "Vorname", null, 40),
|
("GivenName", "Vorname", null, 40),
|
||||||
@@ -19,7 +19,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
("DeliveryRight", "Lieferrecht", "kg", 22),
|
("DeliveryRight", "Lieferrecht", "kg", 22),
|
||||||
("Weight", "Geliefert", "kg", 22),
|
("Weight", "Geliefert", "kg", 22),
|
||||||
("OverUnderDelivery", "Über-/Unterliefert", "kg|%", 34),
|
("OverUnderDelivery", "Über-/Unterliefert", "kg|%", 34),
|
||||||
};
|
];
|
||||||
|
|
||||||
public OverUnderDeliveryData(IEnumerable<OverUnderDeliveryRow> rows, int year) :
|
public OverUnderDeliveryData(IEnumerable<OverUnderDeliveryRow> rows, int year) :
|
||||||
base($"Über-Unterlieferungen", $"Über- und Unterlieferungen laut gezeichneten Geschäftsanteilen {year}", rows, FieldNames) {
|
base($"Über-Unterlieferungen", $"Über- und Unterlieferungen laut gezeichneten Geschäftsanteilen {year}", rows, FieldNames) {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Elwig.Models.Entities;
|
using Elwig.Models.Entities;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@@ -19,7 +20,7 @@ namespace Elwig.Models.Dtos {
|
|||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string FormatAmountCent(long cents) => $"{cents / 100}.{cents % 100:00}";
|
public static string FormatAmountCent(long cents) => $"{cents / 100}.{Math.Abs(cents % 100):00}";
|
||||||
|
|
||||||
public static string FormatAmount(decimal amount) => FormatAmountCent((int)(amount * 100));
|
public static string FormatAmount(decimal amount) => FormatAmountCent((int)(amount * 100));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,19 +68,32 @@ namespace Elwig.Models.Entities {
|
|||||||
|
|
||||||
[InverseProperty("Delivery")]
|
[InverseProperty("Delivery")]
|
||||||
public virtual ISet<DeliveryPart> Parts { get; private set; }
|
public virtual ISet<DeliveryPart> Parts { get; private set; }
|
||||||
|
[NotMapped]
|
||||||
|
public IEnumerable<DeliveryPart> FilteredParts => PartFilter == null ? Parts : Parts.Where(p => PartFilter(p));
|
||||||
|
|
||||||
|
[NotMapped]
|
||||||
|
public Predicate<DeliveryPart>? PartFilter { get; set; }
|
||||||
|
|
||||||
public int Weight => Parts.Select(p => p.Weight).Sum();
|
public int Weight => Parts.Select(p => p.Weight).Sum();
|
||||||
|
public int FilteredWeight => FilteredParts.Select(p => p.Weight).Sum();
|
||||||
|
|
||||||
public IEnumerable<string> SortIds => Parts
|
public IEnumerable<string> SortIds => Parts
|
||||||
.GroupBy(p => p.SortId)
|
.GroupBy(p => p.SortId)
|
||||||
.OrderByDescending(g => g.Select(p => p.Weight).Sum())
|
.OrderByDescending(g => g.Select(p => p.Weight).Sum())
|
||||||
.Select(g => g.Select(p => p.SortId).First());
|
.Select(g => g.Key);
|
||||||
|
public IEnumerable<string> FilteredSortIds => FilteredParts
|
||||||
|
.GroupBy(p => p.SortId)
|
||||||
|
.OrderByDescending(g => g.Select(p => p.Weight).Sum())
|
||||||
|
.Select(g => g.Key);
|
||||||
|
|
||||||
public string SortIdString => string.Join(", ", SortIds);
|
public string SortIdString => string.Join(", ", SortIds);
|
||||||
|
public string FilteredSortIdString => string.Join(", ", FilteredSortIds);
|
||||||
|
|
||||||
public double Kmw => Utils.AggregateDeliveryPartsKmw(Parts);
|
public double Kmw => Utils.AggregateDeliveryPartsKmw(Parts);
|
||||||
|
public double FilteredKmw => Utils.AggregateDeliveryPartsKmw(FilteredParts);
|
||||||
|
|
||||||
public double Oe => Utils.KmwToOe(Kmw);
|
public double Oe => Utils.KmwToOe(Kmw);
|
||||||
|
public double FilteredOe => Utils.KmwToOe(FilteredKmw);
|
||||||
|
|
||||||
public int SearchScore(IEnumerable<string> keywords) {
|
public int SearchScore(IEnumerable<string> keywords) {
|
||||||
var list = new string?[] {
|
var list = new string?[] {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Elwig.Models.Entities {
|
|||||||
public string SortId { get; set; }
|
public string SortId { get; set; }
|
||||||
|
|
||||||
[ForeignKey("SortId")]
|
[ForeignKey("SortId")]
|
||||||
public virtual WineVar Variant { get; private set; }
|
public virtual WineVar Variety { get; private set; }
|
||||||
|
|
||||||
[Column("attrid")]
|
[Column("attrid")]
|
||||||
public string? AttrId { get; set; }
|
public string? AttrId { get; set; }
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ namespace Elwig.Models.Entities {
|
|||||||
|
|
||||||
[Column("start_date")]
|
[Column("start_date")]
|
||||||
public string? StartDateString { get; set; }
|
public string? StartDateString { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public DateOnly? StartDate {
|
public DateOnly? StartDate {
|
||||||
get => StartDateString != null ? DateOnly.ParseExact(StartDateString, "yyyy-MM-dd") : null;
|
get => StartDateString != null ? DateOnly.ParseExact(StartDateString, "yyyy-MM-dd") : null;
|
||||||
@@ -74,13 +73,30 @@ namespace Elwig.Models.Entities {
|
|||||||
|
|
||||||
[Column("end_date")]
|
[Column("end_date")]
|
||||||
public string? EndDateString { get; set; }
|
public string? EndDateString { get; set; }
|
||||||
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public DateOnly? EndDate {
|
public DateOnly? EndDate {
|
||||||
get => EndDateString != null ? DateOnly.ParseExact(EndDateString, "yyyy-MM-dd") : null;
|
get => EndDateString != null ? DateOnly.ParseExact(EndDateString, "yyyy-MM-dd") : null;
|
||||||
set => EndDateString = value?.ToString("yyyy-MM-dd");
|
set => EndDateString = value?.ToString("yyyy-MM-dd");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Column("calc_mode")]
|
||||||
|
public int CalcMode { get; set; }
|
||||||
|
[NotMapped]
|
||||||
|
public bool Billing_HonorGebunden {
|
||||||
|
get => (CalcMode & 0x1) != 0;
|
||||||
|
set => CalcMode = value ? CalcMode | 0x1 : CalcMode & ~0x1;
|
||||||
|
}
|
||||||
|
[NotMapped]
|
||||||
|
public bool Billing_AllowAttrsIntoLower {
|
||||||
|
get => (CalcMode & 0x4) != 0;
|
||||||
|
set => CalcMode = value ? CalcMode | 0x4 : CalcMode & ~0x4;
|
||||||
|
}
|
||||||
|
[NotMapped]
|
||||||
|
public bool Billing_AvoidUnderDeliveries {
|
||||||
|
get => (CalcMode & 0x2) != 0;
|
||||||
|
set => CalcMode = value ? CalcMode | 0x2 : CalcMode & ~0x2;
|
||||||
|
}
|
||||||
|
|
||||||
[ForeignKey("CurrencyCode")]
|
[ForeignKey("CurrencyCode")]
|
||||||
public virtual Currency Currency { get; private set; }
|
public virtual Currency Currency { get; private set; }
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,13 @@ namespace Elwig.Models.Entities {
|
|||||||
[Column("fill_lower")]
|
[Column("fill_lower")]
|
||||||
public int FillLower { get; set; }
|
public int FillLower { get; set; }
|
||||||
|
|
||||||
|
public WineAttr() { }
|
||||||
|
|
||||||
|
public WineAttr(string attrId, string name) {
|
||||||
|
AttrId = attrId;
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return Name;
|
return Name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,13 @@ namespace Elwig.Models.Entities {
|
|||||||
public bool IsRed => Type == "R";
|
public bool IsRed => Type == "R";
|
||||||
public bool IsWhite => Type == "W";
|
public bool IsWhite => Type == "W";
|
||||||
|
|
||||||
|
public WineVar() { }
|
||||||
|
|
||||||
|
public WineVar(string sortId, string name) {
|
||||||
|
SortId = sortId;
|
||||||
|
Name = name;
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString() {
|
public override string ToString() {
|
||||||
return Name;
|
return Name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
-- schema version 11 to 12
|
-- schema version 12 to 13
|
||||||
|
|
||||||
ALTER TABLE season ADD COLUMN bs_value INTEGER;
|
ALTER TABLE season ADD COLUMN bs_value INTEGER;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
-- schema version 13 to 14
|
||||||
|
|
||||||
|
CREATE VIEW v_penalty_area_commitments AS
|
||||||
|
SELECT year, mgnr,
|
||||||
|
SUM(COALESCE(IIF(u.weight = 0, -t.penalty_none, 0), 0) +
|
||||||
|
COALESCE(IIF(u.diff < 0, -t.penalty_amount, 0), 0) +
|
||||||
|
COALESCE(u.diff * t.penalty_per_kg, 0)
|
||||||
|
) AS total_penalty
|
||||||
|
FROM v_under_delivery u
|
||||||
|
JOIN area_commitment_type t ON t.vtrgid = u.bucket
|
||||||
|
GROUP BY year, mgnr
|
||||||
|
HAVING total_penalty < 0
|
||||||
|
ORDER BY year, mgnr;
|
||||||
|
|
||||||
|
CREATE VIEW v_penalty_business_shares AS
|
||||||
|
SELECT s.year, u.mgnr,
|
||||||
|
(COALESCE(IIF(u.weight = 0, -s.penalty_none, 0), 0) +
|
||||||
|
COALESCE(IIF(u.diff < 0, -s.penalty_amount, 0), 0) +
|
||||||
|
COALESCE(u.diff * s.penalty_per_kg, 0)
|
||||||
|
) AS total_penalty
|
||||||
|
FROM v_total_under_delivery u
|
||||||
|
JOIN season s ON s.year = u.year
|
||||||
|
WHERE u.diff < 0 AND total_penalty < 0
|
||||||
|
ORDER BY s.year, u.mgnr;
|
||||||
|
|
||||||
|
CREATE VIEW v_auto_business_shares AS
|
||||||
|
SELECT s.year, h.mgnr,
|
||||||
|
SUM(h.business_shares) AS business_shares,
|
||||||
|
SUM(h.business_shares) * s.bs_value AS total_amount
|
||||||
|
FROM member_history h, season s
|
||||||
|
WHERE h.type = 'auto' AND h.date >= s.year || '-01-01' AND h.date <= s.year || '-12-31'
|
||||||
|
GROUP BY s.year, h.mgnr
|
||||||
|
ORDER BY s.year, h.mgnr;
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
-- schema version 14 to 15
|
||||||
|
|
||||||
|
ALTER TABLE season ADD COLUMN calc_mode INTEGER NOT NULL DEFAULT 0;
|
||||||
|
|
||||||
|
DROP TRIGGER t_payment_delivery_part_u;
|
||||||
|
|
||||||
|
CREATE TRIGGER t_payment_delivery_part_u
|
||||||
|
AFTER UPDATE ON payment_delivery_part FOR EACH ROW
|
||||||
|
BEGIN
|
||||||
|
UPDATE payment_member
|
||||||
|
SET net_amount = net_amount - OLD.amount
|
||||||
|
WHERE (year, avnr, mgnr) IN (SELECT year, OLD.avnr, mgnr FROM delivery WHERE (year, did) = (OLD.year, OLD.did));
|
||||||
|
INSERT INTO payment_member (year, avnr, mgnr, net_amount)
|
||||||
|
SELECT d.year, v.avnr, d.mgnr, NEW.amount
|
||||||
|
FROM delivery d, payment_variant v
|
||||||
|
WHERE (d.year, d.did) = (NEW.year, NEW.did) AND (v.year, v.avnr) = (NEW.year, NEW.avnr)
|
||||||
|
ON CONFLICT DO UPDATE SET net_amount = net_amount + excluded.net_amount;
|
||||||
|
END;
|
||||||
@@ -535,15 +535,18 @@
|
|||||||
</GroupBox>
|
</GroupBox>
|
||||||
<GroupBox Header="Anlieferungsbestätigung" Margin="10,10,10,10" Height="250">
|
<GroupBox Header="Anlieferungsbestätigung" Margin="10,10,10,10" Height="250">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<TextBox x:Name="TextElementDeliveryConfirmation" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" AcceptsReturn="True"
|
<TextBox x:Name="TextElementDeliveryConfirmation" TextWrapping="Wrap" VerticalScrollBarVisibility="Visible" AcceptsReturn="True"
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10,10,10,10" Height="Auto"
|
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10,10,10,10" Height="Auto"
|
||||||
TextChanged="TextBox_TextChanged"/>
|
TextChanged="TextBox_TextChanged"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
<GroupBox Header="Traubengutschrift" Margin="10,10,10,10" Height="250">
|
||||||
|
<Grid>
|
||||||
|
<TextBox x:Name="TextElementCreditNote" 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>
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
public BaseDataWindow() {
|
public BaseDataWindow() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
RequiredInputs = new Control[] {
|
RequiredInputs = [
|
||||||
ClientNameInput, ClientNameTypeInput, ClientNameTokenInput, ClientNameShortInput,
|
ClientNameInput, ClientNameTypeInput, ClientNameTokenInput, ClientNameShortInput,
|
||||||
ClientAddressInput, ClientPlzInput, ClientOrtInput,
|
ClientAddressInput, ClientPlzInput, ClientOrtInput,
|
||||||
};
|
];
|
||||||
ExemptInputs = new Control[] {
|
ExemptInputs = [
|
||||||
ClientNameFull,
|
ClientNameFull,
|
||||||
BranchIdInput, BranchNameInput, BranchPlzInput, BranchOrtInput,
|
BranchIdInput, BranchNameInput, BranchPlzInput, BranchOrtInput,
|
||||||
BranchAddressInput, BranchPhoneNrInput, BranchFaxNrInput, BranchMobileNrInput,
|
BranchAddressInput, BranchPhoneNrInput, BranchFaxNrInput, BranchMobileNrInput,
|
||||||
@@ -30,7 +30,7 @@ namespace Elwig.Windows {
|
|||||||
SeasonMinKgPerBsInput.TextBox, SeasonMaxKgPerBsInput.TextBox, SeasonBsValueInput.TextBox,
|
SeasonMinKgPerBsInput.TextBox, SeasonMaxKgPerBsInput.TextBox, SeasonBsValueInput.TextBox,
|
||||||
SeasonPenaltyPerKgInput.TextBox, SeasonPenaltyInput.TextBox, SeasonPenaltyNoneInput.TextBox,
|
SeasonPenaltyPerKgInput.TextBox, SeasonPenaltyInput.TextBox, SeasonPenaltyNoneInput.TextBox,
|
||||||
SeasonModifierIdInput, SeasonModifierNameInput, SeasonModifierRelInput.TextBox, SeasonModifierAbsInput.TextBox,
|
SeasonModifierIdInput, SeasonModifierNameInput, SeasonModifierRelInput.TextBox, SeasonModifierAbsInput.TextBox,
|
||||||
};
|
];
|
||||||
WineAttributeFillLowerInput.Visibility = Visibility.Hidden;
|
WineAttributeFillLowerInput.Visibility = Visibility.Hidden;
|
||||||
WineAttributeFillLowerLabel.Visibility = Visibility.Hidden;
|
WineAttributeFillLowerLabel.Visibility = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
@@ -297,6 +297,7 @@ namespace Elwig.Windows {
|
|||||||
case 3: ModeDeliveryNoteFull.IsChecked = true; break;
|
case 3: ModeDeliveryNoteFull.IsChecked = true; break;
|
||||||
}
|
}
|
||||||
TextElementDeliveryConfirmation.Text = p.TextDeliveryConfirmation;
|
TextElementDeliveryConfirmation.Text = p.TextDeliveryConfirmation;
|
||||||
|
TextElementCreditNote.Text = p.TextCreditNote;
|
||||||
|
|
||||||
FinishInputFilling();
|
FinishInputFilling();
|
||||||
}
|
}
|
||||||
@@ -322,6 +323,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;
|
p.TextDeliveryConfirmation = TextElementDeliveryConfirmation.Text.Length > 0 ? TextElementDeliveryConfirmation.Text : null;
|
||||||
|
p.TextCreditNote = TextElementCreditNote.Text.Length > 0 ? TextElementCreditNote.Text : null;
|
||||||
|
|
||||||
await p.UpdateValues();
|
await p.UpdateValues();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,13 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:Elwig.Windows"
|
xmlns:local="clr-namespace:Elwig.Windows"
|
||||||
|
xmlns:ctrl="clr-namespace:Elwig.Controls"
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||||
xmlns:ScottPlot="clr-namespace:ScottPlot;assembly=ScottPlot.WPF"
|
xmlns:ScottPlot="clr-namespace:ScottPlot.WPF;assembly=ScottPlot.WPF"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Auszahlung - Elwig" Height="700" Width="1500" MinWidth="1000" MinHeight="500"
|
Title="Auszahlung - Elwig" Height="700" Width="1500" MinWidth="1000" MinHeight="500"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded"
|
||||||
|
Closing="Window_Closing">
|
||||||
|
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style TargetType="Label">
|
<Style TargetType="Label">
|
||||||
@@ -47,61 +49,66 @@
|
|||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="230"/>
|
<ColumnDefinition Width="300"/>
|
||||||
<ColumnDefinition Width="1*"/>
|
<ColumnDefinition Width="1*"/>
|
||||||
<ColumnDefinition Width="200"/>
|
<ColumnDefinition Width="200"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Grid Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3">
|
<Grid Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="3">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="150"/>
|
<ColumnDefinition Width="560"/>
|
||||||
<ColumnDefinition Width="500"/>
|
<ColumnDefinition Width="100"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Label Content="Graph:" Margin="10,0,0,0" FontSize="14" Grid.Column="0" VerticalAlignment="Center"/>
|
<Label Content="Für:" Margin="10,-2,0,0" FontSize="14" Grid.Column="0" VerticalAlignment="Center"/>
|
||||||
<TextBlock x:Name="GraphNum" Margin="0,0,40,0" FontSize="14" Width="50" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right"/>
|
<xctk:CheckComboBox x:Name="VaributeInput" Margin="50,0,0,0" Grid.Column="0" Width="500" Height="25" HorizontalAlignment="Left"
|
||||||
|
IsSelectAllActive="True" SelectAllContent="Alle Sorten" Delimiter=", " AllItemsSelectedContent="Alle Sorten"
|
||||||
<Label Content="Für:" Margin="10,0,0,0" FontSize="14" Grid.Column="1" VerticalAlignment="Center"/>
|
IsEnabled="False" ItemSelectionChanged="VaributeInput_Changed">
|
||||||
<xctk:CheckComboBox x:Name="AppliedInput" Margin="0,10,10,10" Grid.Column="1"
|
<xctk:CheckComboBox.ItemTemplate>
|
||||||
Delimiter=", " AllItemsSelectedContent="Alle"
|
|
||||||
Width="400" HorizontalAlignment="Right">
|
|
||||||
<!--<xctk:CheckComboBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="{}" Width="40"/>
|
<TextBlock Text="{Binding Variety.Name}" Width="150"/>
|
||||||
|
<TextBlock Text="{Binding Variety.Type}" Width="30"/>
|
||||||
|
<TextBlock Text="{Binding Attribute.Name}" Width="120"/>
|
||||||
|
<TextBlock Text="{Binding AssignedGraphId}" Width="30"/>
|
||||||
|
<TextBlock Text="{Binding AssignedAbgewGraphId}" Width="30"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</xctk:CheckComboBox.ItemTemplate>-->
|
</xctk:CheckComboBox.ItemTemplate>
|
||||||
</xctk:CheckComboBox>
|
</xctk:CheckComboBox>
|
||||||
|
|
||||||
|
<CheckBox x:Name="AbgewertetInput" Content="Abgewertet" IsEnabled="False" Checked="AbgewertetInput_Changed" Unchecked="AbgewertetInput_Changed"
|
||||||
|
VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,0" Grid.Column="1"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<ListBox x:Name="GraphList" Margin="10,10,35,50" Grid.Column="0" Grid.Row="1" SelectionChanged="GraphList_SelectionChanged">
|
<ListBox x:Name="GraphList" Margin="10,10,35,42" Grid.Column="0" Grid.Row="0" Grid.RowSpan="2" SelectionChanged="GraphList_SelectionChanged">
|
||||||
<ListBox.ItemTemplate>
|
<ListBox.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Text="{Binding Id}" Width="40"/>
|
<TextBlock Text="{Binding Id}" Width="30"/>
|
||||||
<TextBlock Text="{Binding Contracts}" Width="100"/>
|
<TextBlock Text="{Binding VaributeStringSimple}" ToolTip="{Binding VaributeString}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListBox.ItemTemplate>
|
</ListBox.ItemTemplate>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
|
|
||||||
<Button x:Name="SaveButton" Content="Speichern" IsEnabled="True"
|
<Button x:Name="SaveButton" Content="Speichern" IsEnabled="False"
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="10,5,35,15" Grid.Column="0" Grid.Row="2"
|
HorizontalAlignment="Stretch" VerticalAlignment="Bottom" Margin="10,5,35,10" Grid.Column="0" Grid.Row="2"
|
||||||
Click="SaveButton_Click"/>
|
Click="SaveButton_Click"/>
|
||||||
|
|
||||||
<Button x:Name="AddButton" Content="" FontFamily="Segoe MDL2 Assets" FontSize="11" Padding="0,1.5,0,0" ToolTip="Neue Auszahlungsvariante hinzufügen"
|
<Button x:Name="AddButton" Content="" FontFamily="Segoe MDL2 Assets" FontSize="11" Padding="0,1.5,0,0" ToolTip="Neue Auszahlungsvariante hinzufügen"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="25" Margin="5,0,5,60" Grid.Column="0" Grid.Row="1"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="25" Margin="5,0,5,60" Grid.Column="0" Grid.RowSpan="2" Grid.Row="0"
|
||||||
Click="AddButton_Click"/>
|
Click="AddButton_Click"/>
|
||||||
<Button x:Name="CopyButton" Content="" FontFamily="Segoe MDL2 Assets" FontSize="12" Padding="0,0,0,0" IsEnabled="False" ToolTip="Ausgewählte Auszahlungsvariante duplizieren"
|
<Button x:Name="CopyButton" Content="" FontFamily="Segoe MDL2 Assets" FontSize="12" Padding="0,0,0,0" IsEnabled="False" ToolTip="Ausgewählte Auszahlungsvariante duplizieren"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="25" Margin="0,0,5,0" Grid.Column="0" Grid.Row="1"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="25" Margin="0,0,5,0" Grid.Column="0" Grid.RowSpan="2" Grid.Row="0"
|
||||||
Click="CopyButton_Click"/>
|
Click="CopyButton_Click"/>
|
||||||
<Button x:Name="DeleteButton" Content="" FontFamily="Segoe MDL2 Assets" FontSize="11" Padding="0,1.5,0,0" IsEnabled="False" ToolTip="Ausgewählte Auszahlungsvariante löschen"
|
<Button x:Name="DeleteButton" Content="" FontFamily="Segoe MDL2 Assets" FontSize="11" Padding="0,1.5,0,0" IsEnabled="False" ToolTip="Ausgewählte Auszahlungsvariante löschen"
|
||||||
VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="25" Margin="5,60,5,0" Grid.Column="0" Grid.Row="1"
|
VerticalAlignment="Center" HorizontalAlignment="Right" Width="25" Height="25" Margin="5,60,5,0" Grid.Column="0" Grid.RowSpan="2" Grid.Row="0"
|
||||||
Click="DeleteButton_Click"/>
|
Click="DeleteButton_Click"/>
|
||||||
|
|
||||||
<Grid Grid.Row="1" Grid.Column="1">
|
<Grid Grid.Row="1" Grid.Column="1" Margin="0,0,10,10">
|
||||||
<ScottPlot:WpfPlot x:Name="OechslePricePlot" MouseMove="OechslePricePlot_MouseMove" MouseDown="OechslePricePlot_MouseDown" IsEnabled="False"/>
|
<ScottPlot:WpfPlot x:Name="OechslePricePlot" IsEnabled="False"
|
||||||
|
MouseWheel="OechslePricePlot_MouseWheel" MouseMove="OechslePricePlot_MouseMove" MouseDown="OechslePricePlot_MouseDown"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
<Grid Grid.Row="1" Grid.Column="2" Margin="0,0,5,36">
|
<Grid Grid.Row="1" Grid.Column="2" Margin="0,0,5,36">
|
||||||
@@ -121,48 +128,40 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Label Content="Oechsle:" Margin="10,10,0,0" Grid.Column="0"/>
|
<Label Content="Oechsle:" Margin="10,10,0,0" Grid.Column="0"/>
|
||||||
<TextBox x:Name="OechsleInput" Grid.Column="1" HorizontalAlignment="Left" Margin="0,10,0,0" Text="" Width="90" TextChanged="OechsleInput_TextChanged" LostFocus="OechsleInput_LostFocus"/>
|
<ctrl:UnitTextBox x:Name="OechsleInput" Unit="°Oe" TextChanged="OechsleInput_TextChanged" IsEnabled="False" LostFocus="OechsleInput_LostFocus"
|
||||||
|
Grid.Column="1" Width="90" Margin="0,10,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
|
|
||||||
<Label Content="Preis pro kg:" Margin="10,40,0,0" Grid.Column="0"/>
|
|
||||||
<TextBox x:Name="PriceInput" Grid.Column="1" HorizontalAlignment="Left" Margin="0,40,0,0" Text="" Width="90" TextChanged="PriceInput_TextChanged" LostFocus="PriceInput_LostFocus"/>
|
|
||||||
|
|
||||||
|
<Label Content="Preis:" Margin="10,40,0,0" Grid.Column="0"/>
|
||||||
|
<ctrl:UnitTextBox x:Name="PriceInput" Unit="€/kg" TextChanged="PriceInput_TextChanged" IsEnabled="False" LostFocus="PriceInput_LostFocus"
|
||||||
|
Grid.Column="1" Width="90" Margin="0,40,0,0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="Gebunden" Grid.Row="1" Margin="0,5,5,5">
|
<GroupBox Header="Gebunden Aufschlag" Grid.Row="1" Margin="0,5,5,5">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="85"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<StackPanel Margin="10,10,0,0">
|
<StackPanel Margin="10,10,0,0">
|
||||||
<RadioButton GroupName="GebundenType">Fix</RadioButton>
|
<RadioButton x:Name="GebundenTypeFixed" GroupName="GebundenType" Checked="GebundenType_Checked" IsEnabled="False">Fix</RadioButton>
|
||||||
<RadioButton GroupName="GebundenType">Graph</RadioButton>
|
<RadioButton x:Name="GebundenTypeGraph" GroupName="GebundenType" Checked="GebundenType_Checked" IsEnabled="False">Frei</RadioButton>
|
||||||
<RadioButton GroupName="GebundenType" IsChecked="True">Nein</RadioButton>
|
<RadioButton x:Name="GebundenTypeNone" GroupName="GebundenType" Checked="GebundenType_Checked" IsEnabled="False">Nein</RadioButton>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<TextBox x:Name="GebundenBonus" IsReadOnly="True" Grid.Column="1" HorizontalAlignment="Left" Margin="0,12,0,0" Text="" Width="90" TextChanged="GebundenBonus_TextChanged"/>
|
<ctrl:UnitTextBox x:Name="GebundenFlatBonus" Unit="€/kg" TextChanged="GebundenFlatBonus_TextChanged" IsEnabled="False"
|
||||||
</Grid>
|
Width="90" Margin="5,5,5,5" HorizontalAlignment="Right" VerticalAlignment="Top" Grid.Column="1"/>
|
||||||
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="Aktionen" Grid.Row="2" Margin="0,5,5,5">
|
<GroupBox Header="Aktionen" Grid.Row="2" Margin="0,5,5,5">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
|
|
||||||
<Button x:Name="LeftFlatButton" Content="Links flach" Click="LeftFlatButton_Click" IsEnabled="False"
|
<Button x:Name="LeftFlatButton" Content="Links flach" Click="LeftFlatButton_Click" IsEnabled="False"
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,10,10,10"/>
|
HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,10,10,10"/>
|
||||||
|
|
||||||
<Button x:Name="RightFlatButton" Content="Rechts flach" Click="RightFlatButton_Click" IsEnabled="False"
|
<Button x:Name="RightFlatButton" Content="Rechts flach" Click="RightFlatButton_Click" IsEnabled="False"
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,50,10,10"/>
|
HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,45,10,10"/>
|
||||||
|
|
||||||
<Button x:Name="InterpolateButton" Content="Interpolieren" Click="InterpolateButton_Click" IsEnabled="False"
|
<Button x:Name="InterpolateButton" Content="Interpolieren" Click="InterpolateButton_Click" IsEnabled="False"
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,90,10,10"/>
|
HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,80,10,10"/>
|
||||||
|
|
||||||
<Button x:Name="LinearIncreaseButton" Content="Linear wachsen" Click="LinearIncreaseButton_Click" IsEnabled="False"
|
<Button x:Name="LinearIncreaseButton" Content="Linear wachsen" Click="LinearIncreaseButton_Click" IsEnabled="False"
|
||||||
HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,130,10,10"/>
|
HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="10,115,10,10"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
|
|||||||
+517
-202
@@ -1,115 +1,186 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.Json;
|
|
||||||
using System.Text.Json.Nodes;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using Elwig.Controls;
|
||||||
using Elwig.Helpers;
|
using Elwig.Helpers;
|
||||||
using Elwig.Helpers.Billing;
|
using Elwig.Helpers.Billing;
|
||||||
using Elwig.Models.Entities;
|
using Elwig.Models.Entities;
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
||||||
|
using ScottPlot.Plottables;
|
||||||
using ScottPlot;
|
using ScottPlot;
|
||||||
using ScottPlot.Plottable;
|
using Xceed.Wpf.Toolkit.Primitives;
|
||||||
|
using ScottPlot.Control;
|
||||||
|
|
||||||
namespace Elwig.Windows {
|
namespace Elwig.Windows {
|
||||||
public partial class ChartWindow : ContextWindow {
|
public partial class ChartWindow : ContextWindow {
|
||||||
|
|
||||||
|
public static readonly Color ColorUngebunden = Colors.Blue;
|
||||||
|
public static readonly Color ColorGebunden = Colors.Gold;
|
||||||
|
|
||||||
public readonly int Year;
|
public readonly int Year;
|
||||||
public readonly int AvNr;
|
public readonly int AvNr;
|
||||||
private readonly PaymentVar PaymentVar;
|
public Season Season;
|
||||||
|
private PaymentVar PaymentVar;
|
||||||
|
private bool HasChanged = false;
|
||||||
|
|
||||||
private ScatterPlot OechslePricePlotScatter;
|
private Scatter DataPlot;
|
||||||
private MarkerPlot HighlightedPoint;
|
private Scatter? GebundenPlot;
|
||||||
private MarkerPlot PrimaryMarkedPoint;
|
private Marker HighlightedPointPlot;
|
||||||
private MarkerPlot SecondaryMarkedPoint;
|
private Marker PrimaryMarkedPointPlot;
|
||||||
private Tooltip Tooltip;
|
private Marker SecondaryMarkedPointPlot;
|
||||||
|
private Text TooltipPlot;
|
||||||
|
|
||||||
private int LastHighlightedIndex = -1;
|
private static readonly LegendItem
|
||||||
private int HighlightedIndex = -1;
|
UngebundenLegend = new() {
|
||||||
private int PrimaryMarkedPointIndex = -1;
|
Label = "Ungebunden", LineWidth = 1, LineColor = ColorUngebunden,
|
||||||
private int SecondaryMarkedPointIndex = -1;
|
Marker = new(MarkerShape.FilledCircle, 5, ColorUngebunden)
|
||||||
|
},
|
||||||
|
GebundenLegend = new() {
|
||||||
|
Label = "Gebunden", LineWidth = 1, LineColor = ColorGebunden,
|
||||||
|
Marker = new(MarkerShape.FilledCircle, 5, ColorGebunden)
|
||||||
|
},
|
||||||
|
LdwLegend = new() {
|
||||||
|
Label = "68 °Oe (LDW)", LineWidth = 2, LineColor = Colors.Red, Marker = MarkerStyle.None
|
||||||
|
},
|
||||||
|
QuwLegend = new() {
|
||||||
|
Label = "73 °Oe (QUW)", LineWidth = 2, LineColor = Colors.Orange, Marker = MarkerStyle.None
|
||||||
|
},
|
||||||
|
KabLegend = new() {
|
||||||
|
Label = "84 °Oe (KAB)", LineWidth = 2, LineColor = Colors.Green, Marker = MarkerStyle.None
|
||||||
|
};
|
||||||
|
|
||||||
|
private (Graph? Graph, int Index) LastHighlighted = (null, -1);
|
||||||
|
private (Graph? Graph, int Index) Highlighted = (null, -1);
|
||||||
|
private Graph? ActiveGraph = null;
|
||||||
|
private int PrimaryMarkedPoint = -1;
|
||||||
|
private int SecondaryMarkedPoint = -1;
|
||||||
private bool HoverChanged = false;
|
private bool HoverChanged = false;
|
||||||
private bool HoverActive = false;
|
private bool HoverActive = false;
|
||||||
|
private bool FillingInputs = false;
|
||||||
private const int MinOechsle = 50;
|
|
||||||
private const int MaxOechsle = 140;
|
|
||||||
|
|
||||||
private List<GraphEntry> GraphEntries = [];
|
private List<GraphEntry> GraphEntries = [];
|
||||||
private GraphEntry? SelectedGraphEntry;
|
private GraphEntry? SelectedGraphEntry => (GraphEntry)GraphList.SelectedItem;
|
||||||
|
private List<Varibute> Vaributes = [];
|
||||||
|
private bool AllVaributesAssigned => Vaributes.All(v => v.AssignedGraphId != null);
|
||||||
|
private bool AllVaributesAssignedAbgew => Vaributes.All(v => v.AssignedAbgewGraphId != null);
|
||||||
|
|
||||||
public ChartWindow(int year, int avnr) {
|
public ChartWindow(int year, int avnr) {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
Year = year;
|
Year = year;
|
||||||
AvNr = avnr;
|
AvNr = avnr;
|
||||||
|
Season = Context.Seasons.Find(year) ?? throw new ArgumentException("Season not found");
|
||||||
PaymentVar = Context.PaymentVariants.Find(year, avnr) ?? throw new ArgumentException("PaymentVar not found");
|
PaymentVar = Context.PaymentVariants.Find(year, avnr) ?? throw new ArgumentException("PaymentVar not found");
|
||||||
Title = $"{PaymentVar?.Name} - Lese {year} - Elwig";
|
Title = $"{PaymentVar?.Name} - Lese {year} - Elwig";
|
||||||
|
LockContext = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Loaded(object sender, RoutedEventArgs evt) {
|
private void Window_Loaded(object sender, RoutedEventArgs evt) {
|
||||||
OechslePricePlot.IsEnabled = false;
|
}
|
||||||
|
|
||||||
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) {
|
||||||
|
if (HasChanged) {
|
||||||
|
var r = MessageBox.Show("Soll das Fenster wirklich geschlossen werden? Nicht gespeicherte Änderungen werden NICHT übernommen!", "Schließen bestätigen",
|
||||||
|
MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No);
|
||||||
|
if (r != MessageBoxResult.Yes) {
|
||||||
|
e.Cancel = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetHasChanged(bool hasChanged = true) {
|
||||||
|
HasChanged = hasChanged;
|
||||||
|
SaveButton.IsEnabled = hasChanged;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshGraphList() {
|
private async Task RefreshGraphList() {
|
||||||
await Context.PaymentVariants.LoadAsync();
|
PaymentVar = await Context.PaymentVariants.FindAsync(Year, AvNr) ?? throw new ArgumentException("PaymentVar not found");
|
||||||
await RefreshGraphListQuery();
|
Season = await Context.Seasons.FindAsync(Year) ?? throw new ArgumentException("Season not found");
|
||||||
}
|
|
||||||
|
|
||||||
private async Task RefreshGraphListQuery() {
|
var data = EditBillingData.FromJson(PaymentVar.Data, Utils.GetVaributes(Context, Year));
|
||||||
var attrVariants = Context.DeliveryParts
|
var paymentEntries = data.GetPaymentGraphEntries(Context, Season);
|
||||||
.Where(d => d.Year == Year)
|
GraphEntries = [
|
||||||
.Select(d => $"{d.SortId}{d.AttrId}")
|
..paymentEntries,
|
||||||
.Distinct()
|
..data.GetQualityGraphEntries(Context, Season, paymentEntries.Any() ? paymentEntries.Max(e => e.Id) : 0)
|
||||||
.ToList()
|
];
|
||||||
.Union(Context.WineVarieties.Select(v => v.SortId))
|
Vaributes = Utils.GetVaributeList(Context, Year);
|
||||||
.Order()
|
GraphEntries.ForEach(e => {
|
||||||
.ToList();
|
e.Vaributes.ForEach(v => {
|
||||||
var data = EditBillingData.FromJson(PaymentVar.Data, attrVariants);
|
var found = Vaributes.Find(a => a.Attribute?.AttrId == v.Attribute?.AttrId && a.Variety?.SortId == v.Variety?.SortId);
|
||||||
GraphEntries.AddRange(data.GetPaymentGraphEntries());
|
if (found == null) return;
|
||||||
GraphEntries.AddRange(data.GetQualityGraphEntries());
|
if (e.Abgewertet) {
|
||||||
|
found.AssignedAbgewGraphId = e.Id;
|
||||||
|
} else {
|
||||||
|
found.AssignedGraphId = e.Id;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
ControlUtils.RenewItemsSource(AppliedInput, attrVariants, g => g);
|
FillingInputs = true;
|
||||||
ControlUtils.RenewItemsSource(GraphList, GraphEntries, g => (g as GraphEntry)?.Id, null, ControlUtils.RenewSourceDefault.IfOnly);
|
ControlUtils.RenewItemsSource(VaributeInput, Vaributes, v => (v as Varibute)?.Listing);
|
||||||
|
FillingInputs = false;
|
||||||
|
ControlUtils.RenewItemsSource(GraphList, GraphEntries, g => (g as GraphEntry)?.VaributeStringChange, GraphList_SelectionChanged, ControlUtils.RenewSourceDefault.First);
|
||||||
|
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string ParseContracts(JsonObject auszahlungsSorten, int num) {
|
private void RefreshInputs() {
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RefreshInputs(bool validate = false) {
|
|
||||||
ResetPlot();
|
ResetPlot();
|
||||||
if (!PaymentVar.TestVariant) {
|
if (SelectedGraphEntry != null) {
|
||||||
AddButton.IsEnabled = false;
|
|
||||||
CopyButton.IsEnabled = false;
|
|
||||||
DeleteButton.IsEnabled = false;
|
|
||||||
OechsleInput.IsReadOnly = true;
|
|
||||||
PriceInput.IsReadOnly = true;
|
|
||||||
} else if (SelectedGraphEntry != null) {
|
|
||||||
CopyButton.IsEnabled = true;
|
CopyButton.IsEnabled = true;
|
||||||
DeleteButton.IsEnabled = true;
|
DeleteButton.IsEnabled = true;
|
||||||
OechsleInput.IsReadOnly = false;
|
GebundenTypeFixed.IsEnabled = true;
|
||||||
|
GebundenTypeGraph.IsEnabled = true;
|
||||||
|
GebundenTypeNone.IsEnabled = true;
|
||||||
|
VaributeInput.IsEnabled = true;
|
||||||
|
AbgewertetInput.IsEnabled = true;
|
||||||
EnableOptionButtons();
|
EnableOptionButtons();
|
||||||
FillInputs();
|
FillInputs();
|
||||||
} else {
|
} else {
|
||||||
CopyButton.IsEnabled = false;
|
CopyButton.IsEnabled = false;
|
||||||
DeleteButton.IsEnabled = false;
|
DeleteButton.IsEnabled = false;
|
||||||
OechsleInput.IsReadOnly = true;
|
DisableUnitTextBox(OechsleInput);
|
||||||
DisableOptionButtons();
|
DisableOptionButtons();
|
||||||
}
|
}
|
||||||
|
if (!PaymentVar.TestVariant) {
|
||||||
|
AddButton.IsEnabled = false;
|
||||||
|
CopyButton.IsEnabled = false;
|
||||||
|
DeleteButton.IsEnabled = false;
|
||||||
|
DisableUnitTextBox(OechsleInput);
|
||||||
|
DisableUnitTextBox(PriceInput);
|
||||||
|
GebundenTypeFixed.IsEnabled = false;
|
||||||
|
GebundenTypeGraph.IsEnabled = false;
|
||||||
|
GebundenTypeNone.IsEnabled = false;
|
||||||
|
VaributeInput.IsEnabled = false;
|
||||||
|
AbgewertetInput.IsEnabled = false;
|
||||||
|
}
|
||||||
GC.Collect();
|
GC.Collect();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FillInputs() {
|
private void FillInputs() {
|
||||||
GraphNum.Text = SelectedGraphEntry.Id.ToString();
|
FillingInputs = true;
|
||||||
|
|
||||||
|
AbgewertetInput.IsChecked = SelectedGraphEntry?.Abgewertet;
|
||||||
|
if (SelectedGraphEntry?.GebundenFlatBonus is double bonus) {
|
||||||
|
GebundenTypeFixed.IsChecked = true;
|
||||||
|
GebundenFlatBonus.Text = $"{bonus}";
|
||||||
|
} else if (SelectedGraphEntry?.GebundenGraph != null) {
|
||||||
|
GebundenTypeGraph.IsChecked = true;
|
||||||
|
GebundenFlatBonus.Text = "";
|
||||||
|
} else {
|
||||||
|
GebundenTypeNone.IsChecked = true;
|
||||||
|
GebundenFlatBonus.Text = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
ControlUtils.SelectCheckComboBoxItems(VaributeInput, SelectedGraphEntry?.Vaributes ?? [], i => (i as Varibute)?.Listing);
|
||||||
|
|
||||||
InitPlot();
|
InitPlot();
|
||||||
OechslePricePlot.IsEnabled = true;
|
OechslePricePlot.IsEnabled = true;
|
||||||
|
FillingInputs = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async Task OnRenewContext() {
|
protected override async Task OnRenewContext() {
|
||||||
@@ -117,74 +188,91 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void InitPlot() {
|
private void InitPlot() {
|
||||||
OechslePricePlotScatter = OechslePricePlot.Plot.AddScatter(SelectedGraphEntry.DataGraph.DataX, SelectedGraphEntry.DataGraph.DataY);
|
RefreshGradationLines();
|
||||||
|
|
||||||
OechslePricePlot.Configuration.DoubleClickBenchmark = false;
|
if (SelectedGraphEntry?.GebundenGraph != null) {
|
||||||
OechslePricePlotScatter.LineColor = Color.Blue;
|
GebundenPlot = OechslePricePlot.Plot.Add.Scatter(SelectedGraphEntry.GebundenGraph.DataX, SelectedGraphEntry.GebundenGraph.DataY);
|
||||||
OechslePricePlotScatter.MarkerColor = Color.Blue;
|
GebundenPlot.LineStyle.Color = ColorGebunden;
|
||||||
OechslePricePlotScatter.MarkerSize = 9;
|
GebundenPlot.Color = ColorGebunden;
|
||||||
|
GebundenPlot.MarkerStyle = new MarkerStyle(MarkerShape.FilledCircle, 9, ColorGebunden);
|
||||||
|
}
|
||||||
|
|
||||||
|
DataPlot = OechslePricePlot.Plot.Add.Scatter(SelectedGraphEntry!.DataGraph.DataX, SelectedGraphEntry!.DataGraph.DataY);
|
||||||
|
DataPlot.LineStyle.Color = ColorUngebunden;
|
||||||
|
DataPlot.Color = ColorUngebunden;
|
||||||
|
DataPlot.MarkerStyle = new MarkerStyle(MarkerShape.FilledCircle, 9, ColorUngebunden);
|
||||||
|
|
||||||
|
if (SelectedGraphEntry?.GebundenGraph == null) {
|
||||||
|
ChangeActiveGraph(SelectedGraphEntry?.DataGraph);
|
||||||
|
}
|
||||||
|
|
||||||
|
OechslePricePlot.Interaction.Enable(new PlotActions() {
|
||||||
|
ZoomIn = StandardActions.ZoomIn,
|
||||||
|
ZoomOut = StandardActions.ZoomOut,
|
||||||
|
PanUp = StandardActions.PanUp,
|
||||||
|
PanDown = StandardActions.PanDown,
|
||||||
|
PanLeft = StandardActions.PanLeft,
|
||||||
|
PanRight = StandardActions.PanRight,
|
||||||
|
DragPan = StandardActions.DragPan,
|
||||||
|
DragZoom = StandardActions.DragZoom,
|
||||||
|
DragZoomRectangle = StandardActions.DragZoomRectangle,
|
||||||
|
ZoomRectangleClear = StandardActions.ZoomRectangleClear,
|
||||||
|
ZoomRectangleApply = StandardActions.ZoomRectangleApply,
|
||||||
|
AutoScale = StandardActions.AutoScale,
|
||||||
|
});
|
||||||
|
|
||||||
//OechslePricePlot.Plot.XAxis.ManualTickSpacing(1);
|
//OechslePricePlot.Plot.XAxis.ManualTickSpacing(1);
|
||||||
OechslePricePlot.Plot.YAxis.ManualTickSpacing(0.1);
|
//OechslePricePlot.Plot.YAxis.ManualTickSpacing(0.1);
|
||||||
OechslePricePlot.Plot.SetAxisLimits(MinOechsle - 1, MaxOechsle + 1, -0.1, 2);
|
OechslePricePlot.Plot.Axes.SetLimits(Math.Min(GraphEntry.MinX, GraphEntry.MinXGeb) - 1, GraphEntry.MaxX + 1, -0.1, 1.5);
|
||||||
|
|
||||||
OechslePricePlot.Plot.Layout(padding: 0);
|
|
||||||
OechslePricePlot.Plot.XAxis2.Layout(padding: 0);
|
|
||||||
OechslePricePlot.Plot.YAxis.Layout(padding: 0);
|
|
||||||
OechslePricePlot.Plot.YAxis2.Layout(padding: 0);
|
|
||||||
|
|
||||||
HighlightedPoint = OechslePricePlot.Plot.AddPoint(0, 0);
|
//OechslePricePlot.Plot.Layout(padding: 0);
|
||||||
HighlightedPoint.Color = Color.Red;
|
//OechslePricePlot.Plot.XAxis2.Layout(padding: 0);
|
||||||
HighlightedPoint.MarkerSize = 10;
|
//OechslePricePlot.Plot.YAxis.Layout(padding: 0);
|
||||||
HighlightedPoint.MarkerShape = MarkerShape.openCircle;
|
//OechslePricePlot.Plot.YAxis2.Layout(padding: 0);
|
||||||
HighlightedPoint.IsVisible = false;
|
|
||||||
|
HighlightedPointPlot = OechslePricePlot.Plot.Add.Marker(0, 0, MarkerShape.OpenCircle, 10, Colors.Red);
|
||||||
|
HighlightedPointPlot.IsVisible = false;
|
||||||
|
|
||||||
|
PrimaryMarkedPointPlot = OechslePricePlot.Plot.Add.Marker(0, 0, MarkerShape.FilledCircle, 6, Colors.Red);
|
||||||
|
PrimaryMarkedPointPlot.IsVisible = false;
|
||||||
|
|
||||||
|
SecondaryMarkedPointPlot = OechslePricePlot.Plot.Add.Marker(0, 0, MarkerShape.FilledCircle, 6, Colors.Red);
|
||||||
|
SecondaryMarkedPointPlot.IsVisible = false;
|
||||||
|
|
||||||
PrimaryMarkedPoint = OechslePricePlot.Plot.AddPoint(0, 0);
|
|
||||||
PrimaryMarkedPoint.Color = Color.Red;
|
|
||||||
PrimaryMarkedPoint.MarkerSize = 6;
|
|
||||||
PrimaryMarkedPoint.MarkerShape = MarkerShape.filledCircle;
|
|
||||||
PrimaryMarkedPoint.IsVisible = false;
|
|
||||||
|
|
||||||
SecondaryMarkedPoint = OechslePricePlot.Plot.AddPoint(0, 0);
|
|
||||||
SecondaryMarkedPoint.Color = Color.Red;
|
|
||||||
SecondaryMarkedPoint.MarkerSize = 6;
|
|
||||||
SecondaryMarkedPoint.MarkerShape = MarkerShape.filledCircle;
|
|
||||||
SecondaryMarkedPoint.IsVisible = false;
|
|
||||||
|
|
||||||
OechslePricePlot.Refresh();
|
OechslePricePlot.Refresh();
|
||||||
|
|
||||||
RefreshFreeZoom();
|
RefreshFreeZoom();
|
||||||
RefreshGradationLines();
|
OechslePricePlot.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResetPlot() {
|
private void ResetPlot() {
|
||||||
PrimaryMarkedPointIndex = -1;
|
PrimaryMarkedPoint = -1;
|
||||||
OechslePricePlot.Plot.Remove(OechslePricePlotScatter);
|
SecondaryMarkedPoint = -1;
|
||||||
|
ChangeActiveGraph(null);
|
||||||
|
HideGradationLines();
|
||||||
|
OechslePricePlot.Plot.Remove(DataPlot);
|
||||||
|
if (GebundenPlot != null) {
|
||||||
|
OechslePricePlot.Plot.Remove(GebundenPlot);
|
||||||
|
GebundenPlot = null;
|
||||||
|
}
|
||||||
OechslePricePlot.Plot.Clear();
|
OechslePricePlot.Plot.Clear();
|
||||||
OechslePricePlot.Reset();
|
OechslePricePlot.Reset();
|
||||||
OechslePricePlot.Refresh();
|
OechslePricePlot.Refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ChangeMarker(MarkerPlot point, bool visible, double x = 0, double y = 0) {
|
private void ChangeMarker(Marker point, bool visible, double x = 0, double y = 0) {
|
||||||
point.X = x;
|
point.Location = new Coordinates(x, y);
|
||||||
point.Y = y;
|
|
||||||
point.IsVisible = visible;
|
point.IsVisible = visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void FlattenGraph(int begin, int end, double value) {
|
|
||||||
SelectedGraphEntry.DataGraph.FlattenGraph(begin, end, value);
|
|
||||||
OechslePricePlot.Render();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LinearIncreaseGraph(int begin, int end, double inc) {
|
|
||||||
SelectedGraphEntry.DataGraph.LinearIncreaseGraph(begin, end, inc);
|
|
||||||
OechslePricePlot.Render();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void EnableActionButtons() {
|
private void EnableActionButtons() {
|
||||||
LeftFlatButton.IsEnabled = true;
|
if (PaymentVar.TestVariant) {
|
||||||
RightFlatButton.IsEnabled = true;
|
LeftFlatButton.IsEnabled = true;
|
||||||
LinearIncreaseButton.IsEnabled = true;
|
RightFlatButton.IsEnabled = true;
|
||||||
|
LinearIncreaseButton.IsEnabled = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DisableActionButtons() {
|
private void DisableActionButtons() {
|
||||||
@@ -208,18 +296,32 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void LockZoom() {
|
private void LockZoom() {
|
||||||
OechslePricePlot.Plot.XAxis.SetBoundary(MinOechsle - 1, MaxOechsle + 1);
|
ScottPlot.AxisRules.MaximumBoundary BoundaryRule = new(
|
||||||
OechslePricePlot.Plot.YAxis.SetBoundary(-0.1, 2);
|
xAxis: OechslePricePlot.Plot.Axes.Bottom,
|
||||||
OechslePricePlot.Plot.XAxis.SetZoomOutLimit(MaxOechsle - MinOechsle + 2);
|
yAxis: OechslePricePlot.Plot.Axes.Left,
|
||||||
OechslePricePlot.Plot.YAxis.SetZoomOutLimit(2.1);
|
limits: new AxisLimits(GraphEntry.MinX - 1, GraphEntry.MaxX + 1, -0.1, 2));
|
||||||
OechslePricePlot.Plot.SetAxisLimits(MinOechsle - 1, MaxOechsle + 1, -0.1, 2);
|
|
||||||
|
ScottPlot.AxisRules.MaximumSpan SpanRule = new(
|
||||||
|
xAxis: OechslePricePlot.Plot.Axes.Bottom,
|
||||||
|
yAxis: OechslePricePlot.Plot.Axes.Left,
|
||||||
|
xSpan: GraphEntry.MaxX - GraphEntry.MinX + 2,
|
||||||
|
ySpan: 2.1);
|
||||||
|
|
||||||
|
OechslePricePlot.Plot.Axes.Rules.Clear();
|
||||||
|
OechslePricePlot.Plot.Axes.Rules.Add(BoundaryRule);
|
||||||
|
OechslePricePlot.Plot.Axes.Rules.Add(SpanRule);
|
||||||
|
OechslePricePlot.Plot.Axes.SetLimits(GraphEntry.MinX - 1, GraphEntry.MaxX + 1, -0.1, 1.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UnlockZoom() {
|
private void UnlockZoom() {
|
||||||
OechslePricePlot.Plot.XAxis.SetBoundary();
|
ScottPlot.AxisRules.MaximumSpan SpanRule = new(
|
||||||
OechslePricePlot.Plot.YAxis.SetBoundary();
|
xAxis: OechslePricePlot.Plot.Axes.Bottom,
|
||||||
OechslePricePlot.Plot.XAxis.SetZoomOutLimit((MaxOechsle - MinOechsle) * 1.5);
|
yAxis: OechslePricePlot.Plot.Axes.Left,
|
||||||
OechslePricePlot.Plot.YAxis.SetZoomOutLimit(3.5);
|
xSpan: (GraphEntry.MaxX - GraphEntry.MinX) * 1.5,
|
||||||
|
ySpan: 3.5);
|
||||||
|
|
||||||
|
OechslePricePlot.Plot.Axes.Rules.Clear();
|
||||||
|
OechslePricePlot.Plot.Axes.Rules.Add(SpanRule);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EnableOptionButtons() {
|
private void EnableOptionButtons() {
|
||||||
@@ -239,10 +341,10 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void RefreshGradationLines() {
|
private void RefreshGradationLines() {
|
||||||
if (GradationLinesInput.IsChecked == true) {
|
if (GradationLinesInput.IsChecked == true && SelectedGraphEntry != null && !OechslePricePlot.Plot.PlottableList.OfType<VerticalLine>().Any()) {
|
||||||
ShowGradationLines();
|
ShowGradationLines();
|
||||||
ShowLegend();
|
ShowLegend();
|
||||||
} else {
|
} else if (GradationLinesInput.IsChecked == false) {
|
||||||
HideGradationLines();
|
HideGradationLines();
|
||||||
HideLegend();
|
HideLegend();
|
||||||
}
|
}
|
||||||
@@ -250,100 +352,119 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ShowGradationLines() {
|
private void ShowGradationLines() {
|
||||||
OechslePricePlot.Plot.AddVerticalLine(68, Color.Red, 2, label: "68 Oechsle (LDW)");
|
OechslePricePlot.Plot.Add.VerticalLine(68, 2, Colors.Red);
|
||||||
OechslePricePlot.Plot.AddVerticalLine(73, Color.Orange, 2, label: "73 Oechsle (QUW)");
|
OechslePricePlot.Plot.Add.VerticalLine(73, 2, Colors.Orange);
|
||||||
OechslePricePlot.Plot.AddVerticalLine(84, Color.Green, 2, label: "84 Oechsle (KAB)");
|
OechslePricePlot.Plot.Add.VerticalLine(84, 2, Colors.Green);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HideGradationLines() {
|
private void HideGradationLines() {
|
||||||
OechslePricePlot.Plot.Clear(typeof(VLine));
|
OechslePricePlot.Plot.PlottableList.RemoveAll(p => p is VerticalLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowLegend() {
|
private void ShowLegend() {
|
||||||
OechslePricePlot.Plot.Legend(true, Alignment.UpperRight);
|
OechslePricePlot.Plot.Legend.Location = Alignment.UpperLeft;
|
||||||
|
OechslePricePlot.Plot.Legend.IsVisible = true;
|
||||||
|
|
||||||
|
OechslePricePlot.Plot.Legend.ManualItems.Add(LdwLegend);
|
||||||
|
OechslePricePlot.Plot.Legend.ManualItems.Add(QuwLegend);
|
||||||
|
OechslePricePlot.Plot.Legend.ManualItems.Add(KabLegend);
|
||||||
|
OechslePricePlot.Plot.Legend.ManualItems.Add(UngebundenLegend);
|
||||||
|
if (SelectedGraphEntry?.GebundenGraph != null) OechslePricePlot.Plot.Legend.ManualItems.Add(GebundenLegend);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HideLegend() {
|
private void HideLegend() {
|
||||||
OechslePricePlot.Plot.Legend(false, Alignment.UpperRight);
|
OechslePricePlot.Plot.Legend.IsVisible = false;
|
||||||
|
OechslePricePlot.Plot.Legend.ManualItems.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OechsleInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
private void OechsleInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||||
|
if (ActiveGraph == null || SelectedGraphEntry == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
bool success = int.TryParse(OechsleInput.Text, out int oechsle);
|
bool success = int.TryParse(OechsleInput.Text, out int oechsle);
|
||||||
|
|
||||||
SecondaryMarkedPointIndex = -1;
|
SecondaryMarkedPoint = -1;
|
||||||
ChangeMarker(SecondaryMarkedPoint, false);
|
ChangeMarker(SecondaryMarkedPointPlot, false);
|
||||||
|
|
||||||
if (success) {
|
if (success) {
|
||||||
if (oechsle >= MinOechsle && oechsle <= MaxOechsle) {
|
if (oechsle >= ActiveGraph.MinX && oechsle <= ActiveGraph.MaxX) {
|
||||||
PrimaryMarkedPointIndex = oechsle - MinOechsle;
|
PrimaryMarkedPoint = oechsle - ActiveGraph.MinX;
|
||||||
ChangeMarker(PrimaryMarkedPoint, true, SelectedGraphEntry.DataGraph.DataX[PrimaryMarkedPointIndex], SelectedGraphEntry.DataGraph.DataY[PrimaryMarkedPointIndex]);
|
ChangeMarker(PrimaryMarkedPointPlot, true, ActiveGraph.GetOechsleAt(PrimaryMarkedPoint), ActiveGraph.GetPriceAt(PrimaryMarkedPoint));
|
||||||
|
|
||||||
PriceInput.Text = SelectedGraphEntry.DataGraph.DataY[PrimaryMarkedPointIndex].ToString();
|
PriceInput.Text = Math.Round(ActiveGraph.GetPriceAt(PrimaryMarkedPoint), Season.Precision).ToString();
|
||||||
|
|
||||||
EnableActionButtons();
|
EnableActionButtons();
|
||||||
OechslePricePlot.Render();
|
OechslePricePlot.Refresh();
|
||||||
PriceInput.IsReadOnly = false;
|
EnableUnitTextBox(PriceInput);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PrimaryMarkedPointIndex = -1;
|
PrimaryMarkedPoint = -1;
|
||||||
ChangeMarker(PrimaryMarkedPoint, false);
|
ChangeMarker(PrimaryMarkedPointPlot, false);
|
||||||
DisableActionButtons();
|
DisableActionButtons();
|
||||||
PriceInput.Text = "";
|
PriceInput.Text = "";
|
||||||
OechslePricePlot.Render();
|
DisableUnitTextBox(PriceInput);
|
||||||
PriceInput.IsReadOnly = true;
|
OechslePricePlot.Refresh();
|
||||||
|
DisableUnitTextBox(PriceInput);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PriceInput_TextChanged(object sender, RoutedEventArgs evt) {
|
private void PriceInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||||
if (PrimaryMarkedPointIndex != -1) {
|
if (PrimaryMarkedPoint != -1 && ActiveGraph != null && PriceInput.IsKeyboardFocusWithin == true) {
|
||||||
bool success = Double.TryParse(PriceInput.Text, out double price);
|
var res = Validator.CheckDecimal(PriceInput.TextBox, true, 2, Season.Precision);
|
||||||
|
if (res.IsValid && double.TryParse(PriceInput.Text, out double price)) {
|
||||||
if (success) {
|
ActiveGraph.SetPriceAt(PrimaryMarkedPoint, price);
|
||||||
SelectedGraphEntry.DataGraph.DataY[PrimaryMarkedPointIndex] = price;
|
PrimaryMarkedPointPlot.Location = new Coordinates(PrimaryMarkedPointPlot.Location.X, price);
|
||||||
PrimaryMarkedPoint.Y = price;
|
SetHasChanged();
|
||||||
OechslePricePlot.Refresh();
|
OechslePricePlot.Refresh();
|
||||||
|
CheckGebundenTypeFixed();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LeftFlatButton_Click(object sender, RoutedEventArgs evt) {
|
private void LeftFlatButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
if (PrimaryMarkedPointIndex == -1) {
|
if (PrimaryMarkedPoint == -1 || ActiveGraph == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FlattenGraph(0, PrimaryMarkedPointIndex, SelectedGraphEntry.DataGraph.DataY[PrimaryMarkedPointIndex]);
|
ActiveGraph.FlattenGraphLeft(PrimaryMarkedPoint);
|
||||||
|
SetHasChanged();
|
||||||
|
OechslePricePlot.Refresh();
|
||||||
|
CheckGebundenTypeFixed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RightFlatButton_Click(object sender, RoutedEventArgs evt) {
|
private void RightFlatButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
if (PrimaryMarkedPointIndex == -1) {
|
if (PrimaryMarkedPoint == -1 || ActiveGraph == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
FlattenGraph(PrimaryMarkedPointIndex, SelectedGraphEntry.DataGraph.DataY.Length - 1, SelectedGraphEntry.DataGraph.DataY[PrimaryMarkedPointIndex]);
|
ActiveGraph.FlattenGraphRight(PrimaryMarkedPoint);
|
||||||
|
SetHasChanged();
|
||||||
|
OechslePricePlot.Refresh();
|
||||||
|
CheckGebundenTypeFixed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InterpolateButton_Click(object sender, RoutedEventArgs evt) {
|
private void InterpolateButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
int steps = Math.Abs(PrimaryMarkedPointIndex - SecondaryMarkedPointIndex);
|
if (PrimaryMarkedPoint == SecondaryMarkedPoint || PrimaryMarkedPoint == -1 || SecondaryMarkedPoint == -1 || ActiveGraph == null) {
|
||||||
if (PrimaryMarkedPointIndex == -1 || SecondaryMarkedPointIndex == -1 || steps < 2) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var (lowIndex, highIndex) = PrimaryMarkedPointIndex < SecondaryMarkedPointIndex ? (PrimaryMarkedPointIndex, SecondaryMarkedPointIndex): (SecondaryMarkedPointIndex, PrimaryMarkedPointIndex);
|
ActiveGraph.InterpolateGraph(PrimaryMarkedPoint, SecondaryMarkedPoint);
|
||||||
|
SetHasChanged();
|
||||||
double step = (SelectedGraphEntry.DataGraph.DataY[highIndex] - SelectedGraphEntry.DataGraph.DataY[lowIndex]) / steps;
|
OechslePricePlot.Refresh();
|
||||||
|
CheckGebundenTypeFixed();
|
||||||
for (int i = lowIndex; i < highIndex - 1; i++) {
|
|
||||||
SelectedGraphEntry.DataGraph.DataY[i + 1] = Math.Round(SelectedGraphEntry.DataGraph.DataY[i] + step, 4); // TODO richtig runden
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinearIncreaseButton_Click(object sender, RoutedEventArgs e) {
|
private void LinearIncreaseButton_Click(object sender, RoutedEventArgs e) {
|
||||||
if (PrimaryMarkedPointIndex == -1) {
|
if (PrimaryMarkedPoint == -1 || ActiveGraph == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
double? priceIncrease = Utils.ShowLinearPriceIncreaseDialog();
|
double? priceIncrease = Utils.ShowLinearPriceIncreaseDialog();
|
||||||
if (priceIncrease == null) {
|
if (priceIncrease == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LinearIncreaseGraph(PrimaryMarkedPointIndex, SelectedGraphEntry.DataGraph.DataY.Length - 1, priceIncrease.Value);
|
ActiveGraph.LinearIncreaseGraphToEnd(PrimaryMarkedPoint, priceIncrease.Value);
|
||||||
|
SetHasChanged();
|
||||||
|
OechslePricePlot.Refresh();
|
||||||
|
CheckGebundenTypeFixed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OechslePricePlot_MouseDown(object sender, MouseEventArgs e) {
|
private void OechslePricePlot_MouseDown(object sender, MouseEventArgs e) {
|
||||||
@@ -352,85 +473,130 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (HoverActive) {
|
if (HoverActive) {
|
||||||
if (PaymentVar.TestVariant && Keyboard.IsKeyDown(Key.LeftCtrl)) {
|
if (PaymentVar.TestVariant && Keyboard.IsKeyDown(System.Windows.Input.Key.LeftCtrl)) {
|
||||||
if (PrimaryMarkedPointIndex == -1) {
|
if (PrimaryMarkedPoint == -1 || ActiveGraph == null || ActiveGraph != Highlighted.Graph) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SecondaryMarkedPointIndex = HighlightedIndex;
|
SecondaryMarkedPoint = Highlighted.Index;
|
||||||
ChangeMarker(SecondaryMarkedPoint, true, SelectedGraphEntry.DataGraph.DataX[SecondaryMarkedPointIndex], SelectedGraphEntry.DataGraph.DataY[SecondaryMarkedPointIndex]);
|
|
||||||
|
ChangeMarker(SecondaryMarkedPointPlot, true, ActiveGraph.GetOechsleAt(SecondaryMarkedPoint), ActiveGraph.GetPriceAt(SecondaryMarkedPoint));
|
||||||
|
|
||||||
InterpolateButton.IsEnabled = true;
|
InterpolateButton.IsEnabled = true;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrimaryMarkedPointIndex = HighlightedIndex;
|
PrimaryMarkedPoint = Highlighted.Index;
|
||||||
ChangeMarker(PrimaryMarkedPoint, true, SelectedGraphEntry.DataGraph.DataX[PrimaryMarkedPointIndex], SelectedGraphEntry.DataGraph.DataY[PrimaryMarkedPointIndex]);
|
if (ActiveGraph != Highlighted.Graph) ChangeActiveGraph(Highlighted.Graph);
|
||||||
|
|
||||||
OechsleInput.Text = SelectedGraphEntry.DataGraph.DataX[HighlightedIndex].ToString();
|
ChangeMarker(PrimaryMarkedPointPlot, true, ActiveGraph.GetOechsleAt(PrimaryMarkedPoint), ActiveGraph.GetPriceAt(PrimaryMarkedPoint));
|
||||||
PriceInput.Text = SelectedGraphEntry.DataGraph.DataY[HighlightedIndex].ToString();
|
|
||||||
|
|
||||||
if (PaymentVar.TestVariant) {
|
OechsleInput.Text = Highlighted.Graph.GetOechsleAt(Highlighted.Index).ToString();
|
||||||
EnableActionButtons();
|
PriceInput.Text = Highlighted.Graph.GetPriceAt(Highlighted.Index).ToString();
|
||||||
}
|
|
||||||
|
EnableActionButtons();
|
||||||
} else {
|
} else {
|
||||||
PrimaryMarkedPointIndex = -1;
|
PrimaryMarkedPoint = -1;
|
||||||
SecondaryMarkedPointIndex = -1;
|
SecondaryMarkedPoint = -1;
|
||||||
ChangeMarker(PrimaryMarkedPoint, false);
|
if (SelectedGraphEntry!.GebundenGraph != null) {
|
||||||
ChangeMarker(SecondaryMarkedPoint, false);
|
ChangeActiveGraph(null);
|
||||||
|
}
|
||||||
|
ChangeMarker(PrimaryMarkedPointPlot, false);
|
||||||
|
ChangeMarker(SecondaryMarkedPointPlot, false);
|
||||||
|
|
||||||
OechsleInput.Text = "";
|
OechsleInput.Text = "";
|
||||||
PriceInput.Text = "";
|
PriceInput.Text = "";
|
||||||
|
DisableUnitTextBox(PriceInput);
|
||||||
|
|
||||||
DisableActionButtons();
|
DisableActionButtons();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OechslePricePlot_MouseMove(object sender, MouseEventArgs e) {
|
private void OechslePricePlot_MouseMove(object sender, MouseEventArgs e) {
|
||||||
|
MouseChange(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OechslePricePlot_MouseWheel(object sender, MouseWheelEventArgs e) {
|
||||||
|
MouseChange(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MouseChange(MouseEventArgs e) {
|
||||||
if (GraphList.SelectedItem == null) {
|
if (GraphList.SelectedItem == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
(double mouseCoordX, double mouseCoordY) = OechslePricePlot.GetMouseCoordinates();
|
(double x, double y, int index)? mouseOnData = MouseOnPlot(DataPlot, e.GetPosition(OechslePricePlot));
|
||||||
double xyRatio = OechslePricePlot.Plot.XAxis.Dims.PxPerUnit / OechslePricePlot.Plot.YAxis.Dims.PxPerUnit;
|
(double x, double y, int index)? mouseOnGebunden = MouseOnPlot(GebundenPlot, e.GetPosition(OechslePricePlot));
|
||||||
(double pointX, double pointY, int pointIndex) = OechslePricePlotScatter.GetPointNearest(mouseCoordX, mouseCoordY, xyRatio);
|
|
||||||
|
|
||||||
(double mousePixelX, double mousePixelY) = OechslePricePlot.GetMousePixel();
|
Highlighted = LastHighlighted;
|
||||||
(double pointPixelX, double pointPixelY) = OechslePricePlot.Plot.GetPixel(pointX, pointY);
|
|
||||||
|
|
||||||
HighlightedIndex = LastHighlightedIndex;
|
if (mouseOnData != null) {
|
||||||
|
ChangeMarker(HighlightedPointPlot, true, mouseOnData.Value.x, mouseOnData.Value.y);
|
||||||
if (Math.Abs(mousePixelX - pointPixelX) < 3 && Math.Abs(mousePixelY - pointPixelY) < 3) {
|
HighlightedPointPlot.IsVisible = true;
|
||||||
ChangeMarker(HighlightedPoint, true, pointX, pointY);
|
|
||||||
HighlightedPoint.IsVisible = true;
|
|
||||||
HoverChanged = true ^ HoverActive;
|
HoverChanged = true ^ HoverActive;
|
||||||
HoverActive = true;
|
HoverActive = true;
|
||||||
|
HandleTooltip(mouseOnData.Value.x, mouseOnData.Value.y, mouseOnData.Value.index, SelectedGraphEntry!.DataGraph, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs);
|
||||||
|
} else if (mouseOnGebunden != null) {
|
||||||
|
ChangeMarker(HighlightedPointPlot, true, mouseOnGebunden.Value.x, mouseOnGebunden.Value.y);
|
||||||
|
HighlightedPointPlot.IsVisible = true;
|
||||||
|
HoverChanged = true ^ HoverActive;
|
||||||
|
HoverActive = true;
|
||||||
|
HandleTooltip(mouseOnGebunden.Value.x, mouseOnGebunden.Value.y, mouseOnGebunden.Value.index, SelectedGraphEntry!.GebundenGraph!, e.GetPosition(OechslePricePlot), e is MouseWheelEventArgs);
|
||||||
} else {
|
} else {
|
||||||
ChangeMarker(HighlightedPoint, false);
|
ChangeMarker(HighlightedPointPlot, false);
|
||||||
HoverChanged= false ^ HoverActive;
|
HoverChanged = false ^ HoverActive;
|
||||||
HoverActive= false;
|
HoverActive = false;
|
||||||
OechslePricePlot.Plot.Remove(Tooltip);
|
OechslePricePlot.Plot.PlottableList.Remove(TooltipPlot);
|
||||||
OechslePricePlot.Render();
|
OechslePricePlot.Refresh();
|
||||||
}
|
|
||||||
|
|
||||||
if (LastHighlightedIndex != HighlightedIndex || HoverChanged) {
|
|
||||||
OechslePricePlot.Plot.Remove(Tooltip);
|
|
||||||
if (TooltipInput.IsChecked == true) {
|
|
||||||
Tooltip = OechslePricePlot.Plot.AddTooltip($"Oechsle: {pointX:N2}, Preis: {Math.Round(pointY, 4)})", pointX, pointY);
|
|
||||||
}
|
|
||||||
LastHighlightedIndex = pointIndex;
|
|
||||||
HoverChanged = false;
|
|
||||||
OechslePricePlot.Render();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getMaxGraphId() {
|
private (double, double, int)? MouseOnPlot(Scatter? plot, Point p) {
|
||||||
|
if (plot == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
OechslePricePlot.Refresh();
|
||||||
|
Pixel mousePixel = new(p.X, p.Y);
|
||||||
|
Coordinates mouseLocation = OechslePricePlot.Plot.GetCoordinates(mousePixel);
|
||||||
|
DataPoint nearestPoint = plot.Data.GetNearest(mouseLocation, OechslePricePlot.Plot.LastRender, 3);
|
||||||
|
|
||||||
|
if (nearestPoint.IsReal) {
|
||||||
|
return (nearestPoint.X, nearestPoint.Y, nearestPoint.Index);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleTooltip(double pointX, double pointY, int pointIndex, Graph g, Point p, bool force) {
|
||||||
|
if (force || LastHighlighted != Highlighted || HoverChanged) {
|
||||||
|
OechslePricePlot.Plot.PlottableList.Remove(TooltipPlot);
|
||||||
|
if (TooltipInput.IsChecked == true) {
|
||||||
|
Pixel mousePixel = new(p.X, p.Y - 30);
|
||||||
|
Coordinates mouseLocation = OechslePricePlot.Plot.GetCoordinates(mousePixel);
|
||||||
|
TooltipPlot = OechslePricePlot.Plot.Add.Text($"Oechsle: {pointX:N2}, Preis: {Math.Round(pointY, Season.Precision)}€/kg", mouseLocation.X, mouseLocation.Y);
|
||||||
|
TooltipPlot.Label.FontSize = 12;
|
||||||
|
TooltipPlot.Label.Bold = true;
|
||||||
|
TooltipPlot.Label.BorderColor = Colors.Black;
|
||||||
|
TooltipPlot.Label.BorderWidth = 2;
|
||||||
|
TooltipPlot.Label.BackColor = Colors.White;
|
||||||
|
TooltipPlot.Label.Padding = 10;
|
||||||
|
TooltipPlot.Label.Alignment = Alignment.MiddleLeft;
|
||||||
|
}
|
||||||
|
LastHighlighted = (g, pointIndex);
|
||||||
|
HoverChanged = false;
|
||||||
|
OechslePricePlot.Refresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int GetMaxGraphId() {
|
||||||
return GraphEntries.Count == 0 ? 0 : GraphEntries.Select(g => g.Id).Max();
|
return GraphEntries.Count == 0 ? 0 : GraphEntries.Select(g => g.Id).Max();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddButton_Click(object sender, RoutedEventArgs e) {
|
private void AddButton_Click(object sender, RoutedEventArgs e) {
|
||||||
GraphEntry newGraphEntry = new(getMaxGraphId() + 1, BillingData.CurveMode.Oe, MinOechsle, MaxOechsle);
|
GraphEntry newGraphEntry = new(GetMaxGraphId() + 1, Season.Precision, BillingData.CurveMode.Oe);
|
||||||
GraphEntries.Add(newGraphEntry);
|
GraphEntries.Add(newGraphEntry);
|
||||||
|
SetHasChanged();
|
||||||
GraphList.Items.Refresh();
|
GraphList.Items.Refresh();
|
||||||
GraphList.SelectedItem = newGraphEntry;
|
GraphList.SelectedItem = newGraphEntry;
|
||||||
}
|
}
|
||||||
@@ -438,8 +604,9 @@ namespace Elwig.Windows {
|
|||||||
private void CopyButton_Click(object sender, RoutedEventArgs e) {
|
private void CopyButton_Click(object sender, RoutedEventArgs e) {
|
||||||
if (SelectedGraphEntry == null) return;
|
if (SelectedGraphEntry == null) return;
|
||||||
|
|
||||||
GraphEntry newGraphEntry = SelectedGraphEntry.Copy(getMaxGraphId() + 1);
|
GraphEntry newGraphEntry = SelectedGraphEntry.Copy(GetMaxGraphId() + 1);
|
||||||
GraphEntries.Add(newGraphEntry);
|
GraphEntries.Add(newGraphEntry);
|
||||||
|
SetHasChanged();
|
||||||
GraphList.Items.Refresh();
|
GraphList.Items.Refresh();
|
||||||
GraphList.SelectedItem = newGraphEntry;
|
GraphList.SelectedItem = newGraphEntry;
|
||||||
}
|
}
|
||||||
@@ -448,25 +615,80 @@ namespace Elwig.Windows {
|
|||||||
if (SelectedGraphEntry == null) return;
|
if (SelectedGraphEntry == null) return;
|
||||||
|
|
||||||
var r = MessageBox.Show(
|
var r = MessageBox.Show(
|
||||||
$"Soll der Graph {SelectedGraphEntry.Id} (verwendet in folgenden Verträgen: {SelectedGraphEntry.Contracts}) wirklich gelöscht werden?",
|
$"Soll die Kurve {SelectedGraphEntry.Id} (verwendet in folgenden Verträgen: {SelectedGraphEntry.VaributeStringSimple}) wirklich gelöscht werden?",
|
||||||
"Graph löschen", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No);
|
"Kurve löschen", MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No);
|
||||||
|
|
||||||
if (r == MessageBoxResult.Yes) {
|
if (r == MessageBoxResult.Yes) {
|
||||||
GraphEntries.Remove(SelectedGraphEntry);
|
GraphEntries.Remove(SelectedGraphEntry);
|
||||||
|
SetHasChanged();
|
||||||
GraphList.Items.Refresh();
|
GraphList.Items.Refresh();
|
||||||
|
OechslePricePlot.IsEnabled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SaveButton_Click(object sender, RoutedEventArgs e) {
|
private async void SaveButton_Click(object sender, RoutedEventArgs e) {
|
||||||
//TODO SAVE
|
var origData = BillingData.FromJson(PaymentVar.Data);
|
||||||
|
var data = BillingData.FromGraphEntries(GraphEntries, origData, Utils.GetVaributes(Context, Year, withSlash: true),
|
||||||
|
AllVaributesAssigned, AllVaributesAssignedAbgew);
|
||||||
|
|
||||||
|
EntityEntry<PaymentVar>? tr = null;
|
||||||
|
try {
|
||||||
|
PaymentVar.Data = data.ToJsonString();
|
||||||
|
tr = Context.Update(PaymentVar);
|
||||||
|
await Context.SaveChangesAsync();
|
||||||
|
LockContext = false;
|
||||||
|
tr = null;
|
||||||
|
await App.HintContextChange();
|
||||||
|
} catch (Exception exc) {
|
||||||
|
if (tr != null) await tr.ReloadAsync();
|
||||||
|
var str = "Der Eintrag konnte nicht in der Datenbank gespeichert werden!\n\n" + exc.Message;
|
||||||
|
if (exc.InnerException != null) str += "\n\n" + exc.InnerException.Message;
|
||||||
|
MessageBox.Show(str, "Auszahlungsvariante speichern", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
LockContext = true;
|
||||||
|
SetHasChanged(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void EnableUnitTextBox(UnitTextBox u) {
|
||||||
|
if (PaymentVar.TestVariant) {
|
||||||
|
u.IsEnabled = true;
|
||||||
|
u.TextBox.IsReadOnly = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DisableUnitTextBox(UnitTextBox u) {
|
||||||
|
u.IsEnabled = false;
|
||||||
|
u.TextBox.IsReadOnly = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeActiveGraph(Graph? g) {
|
||||||
|
if (g != null && g == SelectedGraphEntry?.DataGraph) {
|
||||||
|
EnableUnitTextBox(OechsleInput);
|
||||||
|
if (SelectedGraphEntry?.GebundenGraph != null) ChangeLineWidth(DataPlot, 4);
|
||||||
|
ChangeLineWidth(GebundenPlot, 1);
|
||||||
|
} else if (g != null && g == SelectedGraphEntry?.GebundenGraph) {
|
||||||
|
EnableUnitTextBox(OechsleInput);
|
||||||
|
ChangeLineWidth(GebundenPlot, 4);
|
||||||
|
ChangeLineWidth(DataPlot, 1);
|
||||||
|
} else {
|
||||||
|
DisableUnitTextBox(OechsleInput);
|
||||||
|
DisableUnitTextBox(PriceInput);
|
||||||
|
OechsleInput.Text = "";
|
||||||
|
PriceInput.Text = "";
|
||||||
|
ChangeLineWidth(DataPlot, 1);
|
||||||
|
ChangeLineWidth(GebundenPlot, 1);
|
||||||
|
}
|
||||||
|
ActiveGraph = g;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ChangeLineWidth(Scatter? p, double lineWidth) {
|
||||||
|
if (p != null) {
|
||||||
|
p.LineWidth = (float)lineWidth;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GraphList_SelectionChanged(object sender, SelectionChangedEventArgs e) {
|
private void GraphList_SelectionChanged(object sender, SelectionChangedEventArgs e) {
|
||||||
SelectedGraphEntry = (GraphEntry)GraphList.SelectedItem;
|
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
|
|
||||||
//var x = OechslePricePlot.Plot.GetPlottables().OfType<ScatterPlot>();
|
|
||||||
//MessageBox.Show($"SelectionChanged\nLength: {x.ToList().Count}, Ys: {string.Join(", ", ((ScatterPlot)x.First()).Ys)}");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PriceInput_LostFocus(object sender, RoutedEventArgs e) {
|
private void PriceInput_LostFocus(object sender, RoutedEventArgs e) {
|
||||||
@@ -477,8 +699,101 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void GebundenBonus_TextChanged(object sender, TextChangedEventArgs evt) {
|
private void GebundenFlatBonus_TextChanged(object sender, TextChangedEventArgs e) {
|
||||||
|
if (FillingInputs) return;
|
||||||
|
var r = Validator.CheckDecimal(GebundenFlatBonus.TextBox, true, 2, Season.Precision);
|
||||||
|
if (r.IsValid && SelectedGraphEntry != null) {
|
||||||
|
SelectedGraphEntry.GebundenFlatBonus = double.Parse(GebundenFlatBonus.Text);
|
||||||
|
ResetPlot();
|
||||||
|
InitPlot();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void VaributeInput_Changed(object sender, ItemSelectionChangedEventArgs e) {
|
||||||
|
if (FillingInputs || e.Item is not Varibute v) return;
|
||||||
|
var isOpen = VaributeInput.IsDropDownOpen;
|
||||||
|
if (e.IsSelected) {
|
||||||
|
if (RemoveVaributeFromOthers(e.Item.ToString())) {
|
||||||
|
if (AbgewertetInput.IsChecked == true) {
|
||||||
|
v.AssignedAbgewGraphId = SelectedGraphEntry?.Id;
|
||||||
|
} else {
|
||||||
|
v.AssignedGraphId = SelectedGraphEntry?.Id;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
VaributeInput.SelectedItems.Remove(e.Item);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (AbgewertetInput.IsChecked == true) {
|
||||||
|
v.AssignedAbgewGraphId = null;
|
||||||
|
} else {
|
||||||
|
v.AssignedGraphId = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
SelectedGraphEntry!.Vaributes = VaributeInput.SelectedItems.Cast<Varibute>().ToList();
|
||||||
|
SetHasChanged();
|
||||||
|
GraphList.Items.Refresh();
|
||||||
|
VaributeInput.Items.Refresh();
|
||||||
|
VaributeInput.IsDropDownOpen = isOpen;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool RemoveVaributeFromOthers(string? varibute) {
|
||||||
|
if (varibute == null) return true;
|
||||||
|
foreach (var ge in GraphEntries) {
|
||||||
|
if (ge != SelectedGraphEntry && ge.Abgewertet == SelectedGraphEntry?.Abgewertet) {
|
||||||
|
var toRemove = ge.Vaributes.Where(c => c.Listing.Equals(varibute)).ToList();
|
||||||
|
if (toRemove.Count == 0) continue;
|
||||||
|
var r = MessageBox.Show($"Achtung: {string.Join(", ", toRemove)} ist bereits in Kurve {ge.Id} in Verwendung!\nSoll die Zuweisung dort entfernt werden?", "Entfernen bestätigen",
|
||||||
|
MessageBoxButton.YesNo, MessageBoxImage.Warning, MessageBoxResult.No);
|
||||||
|
if (r != MessageBoxResult.Yes) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
ge.Vaributes.RemoveAll(c => c.Listing.Equals(varibute));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AbgewertetInput_Changed(object sender, RoutedEventArgs e) {
|
||||||
|
if (FillingInputs) return;
|
||||||
|
if (SelectedGraphEntry == null) return;
|
||||||
|
SelectedGraphEntry.Abgewertet = AbgewertetInput.IsChecked == true;
|
||||||
|
SetHasChanged();
|
||||||
|
GraphList.Items.Refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void GebundenType_Checked(object sender, RoutedEventArgs e) {
|
||||||
|
if (FillingInputs) return;
|
||||||
|
if (SelectedGraphEntry == null) {
|
||||||
|
DisableUnitTextBox(GebundenFlatBonus);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (GebundenTypeNone.IsChecked == true) {
|
||||||
|
SelectedGraphEntry.RemoveGebundenGraph();
|
||||||
|
DisableUnitTextBox(GebundenFlatBonus);
|
||||||
|
} else if (GebundenTypeFixed.IsChecked == true) {
|
||||||
|
SelectedGraphEntry.GebundenFlatBonus = double.TryParse(GebundenFlatBonus.Text, out var val) ? val : 0.1;
|
||||||
|
SelectedGraphEntry.AddGebundenGraph();
|
||||||
|
EnableUnitTextBox(GebundenFlatBonus);
|
||||||
|
} else if (GebundenTypeGraph.IsChecked == true) {
|
||||||
|
SelectedGraphEntry.AddGebundenGraph();
|
||||||
|
DisableUnitTextBox(GebundenFlatBonus);
|
||||||
|
}
|
||||||
|
SetHasChanged();
|
||||||
|
RefreshInputs();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CheckGebundenTypeFixed() {
|
||||||
|
FillingInputs = true;
|
||||||
|
if (SelectedGraphEntry?.GebundenFlatBonus is double bonus) {
|
||||||
|
GebundenTypeFixed.IsChecked = true;
|
||||||
|
GebundenFlatBonus.Text = $"{bonus}";
|
||||||
|
EnableUnitTextBox(GebundenFlatBonus);
|
||||||
|
} else if (SelectedGraphEntry?.GebundenGraph != null) {
|
||||||
|
GebundenTypeGraph.IsChecked = true;
|
||||||
|
GebundenFlatBonus.Text = "";
|
||||||
|
DisableUnitTextBox(GebundenFlatBonus);
|
||||||
|
}
|
||||||
|
FillingInputs = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -101,12 +101,12 @@
|
|||||||
Filtern nach:<LineBreak/>
|
Filtern nach:<LineBreak/>
|
||||||
<Bold>Sorte</Bold>: z.B. GV, ZW, rr, sa, !gv (ausgenommen GV), ...<LineBreak/>
|
<Bold>Sorte</Bold>: z.B. GV, ZW, rr, sa, !gv (ausgenommen GV), ...<LineBreak/>
|
||||||
<Bold>Rot/Weiß</Bold>: z.B. r, Rot, w, weiß, ...<LineBreak/>
|
<Bold>Rot/Weiß</Bold>: z.B. r, Rot, w, weiß, ...<LineBreak/>
|
||||||
<Bold>Qualitätsstufe</Bold>: z.B. QUW, kab, !ldw (ausgenommen LDW), ...<LineBreak/>
|
<Bold>Qualitätsstufe</Bold>: z.B. QUW, kab, !ldw (ausgenommen LDW), abgew[ertet], ...<LineBreak/>
|
||||||
<Bold>Gradation</Bold>: z.B. >73, <15, 17-18, 15-, >17,5, 62-75, ...<LineBreak/>
|
<Bold>Gradation</Bold>: z.B. >73, <15, 17-18, 15-, >17,5, 62-75, ...<LineBreak/>
|
||||||
<Bold>Mitglied</Bold>: z.B. 1234, 987, ...<LineBreak/>
|
<Bold>Mitglied</Bold>: z.B. 1234, 987, ...<LineBreak/>
|
||||||
<Bold>Saison</Bold>: z.B. 2020, >2015, 2017-2019, <2005, 2019-, ...<LineBreak/>
|
<Bold>Saison</Bold>: z.B. 2020, >2015, 2017-2019, <2005, 2019-, ...<LineBreak/>
|
||||||
<Bold>Zweigstelle</Bold>: z.B. musterort, ...<LineBreak/>
|
<Bold>Zweigstelle</Bold>: z.B. musterort, ...<LineBreak/>
|
||||||
<Bold>Attribute</Bold>: z.B. kabinett, !kabinett (alle außer kabinett), ...<LineBreak/>
|
<Bold>Attribut</Bold>: z.B. kabinett, !kabinett (alle außer kabinett), ...<LineBreak/>
|
||||||
<Bold>Datum</Bold>: z.B. 1.9., 15.9.-10.10., -15.10.2020, ...<LineBreak/>
|
<Bold>Datum</Bold>: z.B. 1.9., 15.9.-10.10., -15.10.2020, ...<LineBreak/>
|
||||||
<Bold>Uhrzeit</Bold>: z.B. 06:00-08:00, 18:00-, ...<LineBreak/>
|
<Bold>Uhrzeit</Bold>: z.B. 06:00-08:00, 18:00-, ...<LineBreak/>
|
||||||
<Bold>Freitext</Bold>: z.B. Lieferscheinnummern, Anmerkung, "quw" (sucht nach dem Text "quw")
|
<Bold>Freitext</Bold>: z.B. Lieferscheinnummern, Anmerkung, "quw" (sucht nach dem Text "quw")
|
||||||
@@ -148,21 +148,21 @@
|
|||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.CellStyle>
|
</DataGridTextColumn.CellStyle>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="Sorte" Binding="{Binding SortIdString}" Width="50">
|
<DataGridTextColumn Header="Sorte" Binding="{Binding FilteredSortIdString}" Width="50">
|
||||||
<DataGridTextColumn.CellStyle>
|
<DataGridTextColumn.CellStyle>
|
||||||
<Style>
|
<Style>
|
||||||
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
<Setter Property="TextBlock.TextAlignment" Value="Center"/>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.CellStyle>
|
</DataGridTextColumn.CellStyle>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="Gewicht" Binding="{Binding Weight, StringFormat='{}{0:N0} kg '}" Width="75">
|
<DataGridTextColumn Header="Gewicht" Binding="{Binding FilteredWeight, StringFormat='{}{0:N0} kg '}" Width="75">
|
||||||
<DataGridTextColumn.CellStyle>
|
<DataGridTextColumn.CellStyle>
|
||||||
<Style>
|
<Style>
|
||||||
<Setter Property="TextBlock.TextAlignment" Value="Right"/>
|
<Setter Property="TextBlock.TextAlignment" Value="Right"/>
|
||||||
</Style>
|
</Style>
|
||||||
</DataGridTextColumn.CellStyle>
|
</DataGridTextColumn.CellStyle>
|
||||||
</DataGridTextColumn>
|
</DataGridTextColumn>
|
||||||
<DataGridTextColumn Header="Gradation" Binding="{Binding Kmw, StringFormat='{}{0:N1}° '}" Width="50">
|
<DataGridTextColumn Header="Gradation" Binding="{Binding FilteredKmw, StringFormat='{}{0:N1}° '}" Width="50">
|
||||||
<DataGridTextColumn.CellStyle>
|
<DataGridTextColumn.CellStyle>
|
||||||
<Style>
|
<Style>
|
||||||
<Setter Property="TextBlock.TextAlignment" Value="Right"/>
|
<Setter Property="TextBlock.TextAlignment" Value="Right"/>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Linq.Expressions;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
@@ -27,7 +28,10 @@ namespace Elwig.Windows {
|
|||||||
private Member? Member = null;
|
private Member? Member = null;
|
||||||
private readonly DispatcherTimer Timer;
|
private readonly DispatcherTimer Timer;
|
||||||
private List<string> TextFilter = [];
|
private List<string> TextFilter = [];
|
||||||
private readonly RoutedCommand CtrlF = new();
|
|
||||||
|
private readonly RoutedCommand CtrlF = new("CtrlF", typeof(DeliveryAdminWindow), [new KeyGesture(Key.F, ModifierKeys.Control)]);
|
||||||
|
private readonly RoutedCommand CtrlP = new("CtrlP", typeof(DeliveryAdminWindow), [new KeyGesture(Key.P, ModifierKeys.Control)]);
|
||||||
|
private readonly RoutedCommand CtrlShiftP = new("CtrlShiftP", typeof(DeliveryAdminWindow), [new KeyGesture(Key.P, ModifierKeys.Control | ModifierKeys.Shift)]);
|
||||||
|
|
||||||
private string? LastScaleError = null;
|
private string? LastScaleError = null;
|
||||||
private string? ManualWeighingReason = null;
|
private string? ManualWeighingReason = null;
|
||||||
@@ -37,8 +41,9 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
public DeliveryAdminWindow(bool receipt = false) {
|
public DeliveryAdminWindow(bool receipt = false) {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
CtrlF.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
|
|
||||||
CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput));
|
CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput));
|
||||||
|
CommandBindings.Add(new CommandBinding(CtrlP, Menu_Print_ShowDeliveryNote_Click));
|
||||||
|
CommandBindings.Add(new CommandBinding(CtrlShiftP, Menu_Print_PrintDeliveryNote_Click));
|
||||||
RequiredInputs = [
|
RequiredInputs = [
|
||||||
MgNrInput, MemberInput,
|
MgNrInput, MemberInput,
|
||||||
LsNrInput, DateInput, BranchInput,
|
LsNrInput, DateInput, BranchInput,
|
||||||
@@ -168,7 +173,7 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
private async void Menu_Print_DeliveryJournal_ShowFilter_Click(object sender, RoutedEventArgs evt) {
|
private async void Menu_Print_DeliveryJournal_ShowFilter_Click(object sender, RoutedEventArgs evt) {
|
||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
var (f, _, d, _) = await GetFilters();
|
var (f, _, d, _, _) = await GetFilters();
|
||||||
var doc = new DeliveryJournal(string.Join(" / ", f), d);
|
var doc = new DeliveryJournal(string.Join(" / ", f), d);
|
||||||
await doc.Generate();
|
await doc.Generate();
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
@@ -177,7 +182,7 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
private async void Menu_Print_DeliveryJournal_PrintFilter_Click(object sender, RoutedEventArgs evt) {
|
private async void Menu_Print_DeliveryJournal_PrintFilter_Click(object sender, RoutedEventArgs evt) {
|
||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
var (f, _, d, _) = await GetFilters();
|
var (f, _, d, _, _) = await GetFilters();
|
||||||
var doc = new DeliveryJournal(string.Join(" / ", f), d);
|
var doc = new DeliveryJournal(string.Join(" / ", f), d);
|
||||||
await doc.Generate();
|
await doc.Generate();
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
@@ -296,7 +301,7 @@ namespace Elwig.Windows {
|
|||||||
await RefreshDeliveryListQuery();
|
await RefreshDeliveryListQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<(List<string>, IQueryable<Delivery>, IQueryable<DeliveryPart>, List<string>)> GetFilters() {
|
private async Task<(List<string>, IQueryable<Delivery>, IQueryable<DeliveryPart>, Predicate<DeliveryPart>, List<string>)> GetFilters() {
|
||||||
List<string> filterNames = [];
|
List<string> filterNames = [];
|
||||||
IQueryable<Delivery> deliveryQuery = Context.Deliveries;
|
IQueryable<Delivery> deliveryQuery = Context.Deliveries;
|
||||||
if (IsReceipt && App.BranchNum > 1) {
|
if (IsReceipt && App.BranchNum > 1) {
|
||||||
@@ -316,12 +321,8 @@ namespace Elwig.Windows {
|
|||||||
deliveryQuery = deliveryQuery.Where(d => d.Year == SeasonInput.Value);
|
deliveryQuery = deliveryQuery.Where(d => d.Year == SeasonInput.Value);
|
||||||
filterNames.Add(SeasonInput.Value.ToString() ?? "");
|
filterNames.Add(SeasonInput.Value.ToString() ?? "");
|
||||||
}
|
}
|
||||||
IQueryable<DeliveryPart> dpq = deliveryQuery
|
|
||||||
.SelectMany(d => d.Parts)
|
Expression<Func<DeliveryPart, bool>> prd = p => true;
|
||||||
.OrderBy(p => p.Delivery.DateString)
|
|
||||||
.ThenBy(p => p.Delivery.TimeString)
|
|
||||||
.ThenBy(p => p.Delivery.LsNr)
|
|
||||||
.ThenBy(p => p.DPNr);
|
|
||||||
|
|
||||||
var filterVar = new List<string>();
|
var filterVar = new List<string>();
|
||||||
var filterNotVar = new List<string>();
|
var filterNotVar = new List<string>();
|
||||||
@@ -364,13 +365,23 @@ namespace Elwig.Windows {
|
|||||||
filter.RemoveAt(i--);
|
filter.RemoveAt(i--);
|
||||||
filterNames.Add("außer " + var[e[1..].ToUpper()].Name);
|
filterNames.Add("außer " + var[e[1..].ToUpper()].Name);
|
||||||
} else if (e.Length == 3 && qual.ContainsKey(e.ToUpper())) {
|
} else if (e.Length == 3 && qual.ContainsKey(e.ToUpper())) {
|
||||||
filterQual.Add(e.ToUpper());
|
var qualId = e.ToUpper();
|
||||||
|
filterQual.Add(qualId);
|
||||||
filter.RemoveAt(i--);
|
filter.RemoveAt(i--);
|
||||||
filterNames.Add(qual[e.ToUpper()].Name);
|
filterNames.Add(qualId == "WEI" ? "abgewertet" : qual[e.ToUpper()].Name);
|
||||||
} else if (e[0] == '!' && qual.ContainsKey(e[1..].ToUpper())) {
|
} else if (e[0] == '!' && qual.ContainsKey(e[1..].ToUpper())) {
|
||||||
filterNotQual.Add(e[1..].ToUpper());
|
var qualId = e[1..].ToUpper();
|
||||||
|
filterNotQual.Add(qualId);
|
||||||
filter.RemoveAt(i--);
|
filter.RemoveAt(i--);
|
||||||
filterNames.Add("außer " + qual[e[1..].ToUpper()].Name);
|
filterNames.Add(qualId == "WEI" ? "nicht abgewertet" : "außer " + qual[e[1..].ToUpper()].Name);
|
||||||
|
} else if (e.Length >= 5 && e.Length <= 10 && "abgewertet".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||||
|
filterQual.Add("WEI");
|
||||||
|
filter.RemoveAt(i--);
|
||||||
|
filterNames.Add("abgewertet");
|
||||||
|
} else if (e.Length >= 6 && e.Length <= 11 && "!abgewertet".StartsWith(e, StringComparison.CurrentCultureIgnoreCase)) {
|
||||||
|
filterNotQual.Add("WEI");
|
||||||
|
filter.RemoveAt(i--);
|
||||||
|
filterNames.Add("nicht abgewertet");
|
||||||
} else if (e.All(char.IsAsciiDigit) && mgnr.TryGetValue(e, out var member)) {
|
} else if (e.All(char.IsAsciiDigit) && mgnr.TryGetValue(e, out var member)) {
|
||||||
filterMgNr.Add(int.Parse(e));
|
filterMgNr.Add(int.Parse(e));
|
||||||
filter.RemoveAt(i--);
|
filter.RemoveAt(i--);
|
||||||
@@ -487,32 +498,32 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filterYearGt > 0) dpq = dpq.Where(p => p.Year >= filterYearGt);
|
if (filterYearGt > 0) prd = prd.And(p => p.Year >= filterYearGt);
|
||||||
if (filterYearLt > 0) dpq = dpq.Where(p => p.Year < filterYearLt);
|
if (filterYearLt > 0) prd = prd.And(p => p.Year < filterYearLt);
|
||||||
if (filterMgNr.Count > 0) dpq = dpq.Where(p => filterMgNr.Contains(p.Delivery.MgNr));
|
if (filterMgNr.Count > 0) prd = prd.And(p => filterMgNr.Contains(p.Delivery.MgNr));
|
||||||
if (filterDate.Count > 0) {
|
if (filterDate.Count > 0) {
|
||||||
var pr = PredicateBuilder.New<DeliveryPart>(false);
|
var pr = PredicateBuilder.New<DeliveryPart>(false);
|
||||||
foreach (var (d1, d2) in filterDate)
|
foreach (var (d1, d2) in filterDate)
|
||||||
pr.Or(p => (d1 == null || d1.CompareTo(p.Delivery.DateString.Substring(10 - d1.Length)) <= 0) && (d2 == null || d2.CompareTo(p.Delivery.DateString.Substring(10 - d2.Length)) >= 0));
|
pr.Or(p => (d1 == null || d1.CompareTo(p.Delivery.DateString.Substring(10 - d1.Length)) <= 0) && (d2 == null || d2.CompareTo(p.Delivery.DateString.Substring(10 - d2.Length)) >= 0));
|
||||||
dpq = dpq.Where(pr);
|
prd = prd.And(pr);
|
||||||
}
|
}
|
||||||
if (filterTime.Count > 0) {
|
if (filterTime.Count > 0) {
|
||||||
var pr = PredicateBuilder.New<DeliveryPart>(false);
|
var pr = PredicateBuilder.New<DeliveryPart>(false);
|
||||||
foreach (var (t1, t2) in filterTime)
|
foreach (var (t1, t2) in filterTime)
|
||||||
pr.Or(p => (t1 == null || t1.CompareTo(p.Delivery.TimeString) <= 0) && (t2 == null || t2.CompareTo(p.Delivery.TimeString) > 0));
|
pr.Or(p => (t1 == null || t1.CompareTo(p.Delivery.TimeString) <= 0) && (t2 == null || t2.CompareTo(p.Delivery.TimeString) > 0));
|
||||||
dpq = dpq.Where(p => p.Delivery.TimeString != null).Where(pr);
|
prd = prd.And(p => p.Delivery.TimeString != null).And(pr);
|
||||||
}
|
}
|
||||||
if (filterVar.Count > 0) dpq = dpq.Where(p => filterVar.Contains(p.SortId));
|
if (filterVar.Count > 0) prd = prd.And(p => filterVar.Contains(p.SortId));
|
||||||
if (filterNotVar.Count > 0) dpq = dpq.Where(p => !filterNotVar.Contains(p.SortId));
|
if (filterNotVar.Count > 0) prd = prd.And(p => !filterNotVar.Contains(p.SortId));
|
||||||
if (filterQual.Count > 0) dpq = dpq.Where(p => filterQual.Contains(p.QualId));
|
if (filterQual.Count > 0) prd = prd.And(p => filterQual.Contains(p.QualId));
|
||||||
if (filterNotQual.Count > 0) dpq = dpq.Where(p => !filterNotQual.Contains(p.QualId));
|
if (filterNotQual.Count > 0) prd = prd.And(p => !filterNotQual.Contains(p.QualId));
|
||||||
if (filterZwst.Count > 0) dpq = dpq.Where(p => filterZwst.Contains(p.Delivery.ZwstId));
|
if (filterZwst.Count > 0) prd = prd.And(p => filterZwst.Contains(p.Delivery.ZwstId));
|
||||||
if (filterAttr.Count > 0) dpq = dpq.Where(p => p.AttrId != null && filterAttr.Contains(p.AttrId));
|
if (filterAttr.Count > 0) prd = prd.And(p => p.AttrId != null && filterAttr.Contains(p.AttrId));
|
||||||
if (filterNotAttr.Count > 0) dpq = dpq.Where(p => p.AttrId == null || !filterNotAttr.Contains(p.AttrId));
|
if (filterNotAttr.Count > 0) prd = prd.And(p => p.AttrId == null || !filterNotAttr.Contains(p.AttrId));
|
||||||
if (filterKmwGt > 0) dpq = dpq.Where(p => p.Kmw >= filterKmwGt);
|
if (filterKmwGt > 0) prd = prd.And(p => p.Kmw >= filterKmwGt);
|
||||||
if (filterKmwLt > 0) dpq = dpq.Where(p => p.Kmw < filterKmwLt);
|
if (filterKmwLt > 0) prd = prd.And(p => p.Kmw < filterKmwLt);
|
||||||
if (filterOeGt > 0) dpq = dpq.Where(p => p.Kmw * (4.54 + 0.022 * p.Kmw) >= filterOeGt);
|
if (filterOeGt > 0) prd = prd.And(p => p.Kmw * (4.54 + 0.022 * p.Kmw) >= filterOeGt);
|
||||||
if (filterOeLt > 0) dpq = dpq.Where(p => p.Kmw * (4.54 + 0.022 * p.Kmw) < filterOeLt);
|
if (filterOeLt > 0) prd = prd.And(p => p.Kmw * (4.54 + 0.022 * p.Kmw) < filterOeLt);
|
||||||
|
|
||||||
if (filterYearGt > 0 && filterYearLt > 0) {
|
if (filterYearGt > 0 && filterYearLt > 0) {
|
||||||
filterNames.Insert(0, $"{filterYearGt}–{filterYearLt - 1}");
|
filterNames.Insert(0, $"{filterYearGt}–{filterYearLt - 1}");
|
||||||
@@ -537,7 +548,15 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (filterNames, dpq.Select(p => p.Delivery).Distinct().OrderBy(d => d.DateString).ThenBy(d => d.TimeString), dpq, filter);
|
IQueryable<DeliveryPart> dpq = deliveryQuery
|
||||||
|
.SelectMany(d => d.Parts)
|
||||||
|
.Where(prd)
|
||||||
|
.OrderBy(p => p.Delivery.DateString)
|
||||||
|
.ThenBy(p => p.Delivery.TimeString)
|
||||||
|
.ThenBy(p => p.Delivery.LsNr)
|
||||||
|
.ThenBy(p => p.DPNr);
|
||||||
|
|
||||||
|
return (filterNames, dpq.Select(p => p.Delivery).Distinct().OrderBy(d => d.DateString).ThenBy(d => d.TimeString), dpq, prd.Invoke, filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void AddToolTipCell(Grid grid, string text, int row, int col, int colSpan = 1, bool bold = false, bool alignRight = false, bool alignCenter = false) {
|
private static void AddToolTipCell(Grid grid, string text, int row, int col, int colSpan = 1, bool bold = false, bool alignRight = false, bool alignCenter = false) {
|
||||||
@@ -573,7 +592,7 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async Task RefreshDeliveryListQuery(bool updateSort = false) {
|
private async Task RefreshDeliveryListQuery(bool updateSort = false) {
|
||||||
var (_, deliveryQuery, deliveryPartsQuery, filter) = await GetFilters();
|
var (_, deliveryQuery, deliveryPartsQuery, predicate, filter) = await GetFilters();
|
||||||
var deliveries = await deliveryQuery.ToListAsync();
|
var deliveries = await deliveryQuery.ToListAsync();
|
||||||
deliveries.Reverse();
|
deliveries.Reverse();
|
||||||
|
|
||||||
@@ -589,8 +608,10 @@ namespace Elwig.Windows {
|
|||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
deliveries.ForEach(d => { d.PartFilter = predicate; });
|
||||||
ControlUtils.RenewItemsSource(DeliveryList, deliveries, d => ((d as Delivery)?.Year, (d as Delivery)?.DId),
|
ControlUtils.RenewItemsSource(DeliveryList, deliveries, d => ((d as Delivery)?.Year, (d as Delivery)?.DId),
|
||||||
DeliveryList_SelectionChanged, filter.Count > 0 ? ControlUtils.RenewSourceDefault.IfOnly : ControlUtils.RenewSourceDefault.None, !updateSort);
|
DeliveryList_SelectionChanged, filter.Count > 0 ? ControlUtils.RenewSourceDefault.IfOnly : ControlUtils.RenewSourceDefault.None, !updateSort);
|
||||||
|
await RefreshDeliveryParts();
|
||||||
|
|
||||||
var members = deliveries.Select(d => d.Member).DistinctBy(m => m.MgNr).ToList();
|
var members = deliveries.Select(d => d.Member).DistinctBy(m => m.MgNr).ToList();
|
||||||
StatusMembers.Text = $"Mitglieder: {members.Count}" + (members.Count > 0 && members.Count <= 4 ? $" ({string.Join(", ", members.Select(m => m.AdministrativeName))})" : "");
|
StatusMembers.Text = $"Mitglieder: {members.Count}" + (members.Count > 0 && members.Count <= 4 ? $" ({string.Join(", ", members.Select(m => m.AdministrativeName))})" : "");
|
||||||
@@ -722,7 +743,7 @@ namespace Elwig.Windows {
|
|||||||
Menu_Export_Bki.Items.Clear();
|
Menu_Export_Bki.Items.Clear();
|
||||||
foreach (var s in await Context.Seasons.OrderByDescending(s => s.Year).ToListAsync()) {
|
foreach (var s in await Context.Seasons.OrderByDescending(s => s.Year).ToListAsync()) {
|
||||||
var i = new MenuItem {
|
var i = new MenuItem {
|
||||||
Header = $"Season {s.Year}",
|
Header = $"Saison {s.Year}",
|
||||||
};
|
};
|
||||||
i.Click += Menu_Export_Bki_Click;
|
i.Click += Menu_Export_Bki_Click;
|
||||||
Menu_Export_Bki.Items.Add(i);
|
Menu_Export_Bki.Items.Add(i);
|
||||||
@@ -760,7 +781,7 @@ namespace Elwig.Windows {
|
|||||||
private async Task RefreshDeliveryParts() {
|
private async Task RefreshDeliveryParts() {
|
||||||
if (DeliveryList.SelectedItem is Delivery d) {
|
if (DeliveryList.SelectedItem is Delivery d) {
|
||||||
ControlUtils.RenewItemsSource(ModifiersInput, await Context.Modifiers.Where(m => m.Year == d.Year).OrderBy(m => m.Ordering).ToListAsync(), i => (i as Modifier)?.ModId);
|
ControlUtils.RenewItemsSource(ModifiersInput, await Context.Modifiers.Where(m => m.Year == d.Year).OrderBy(m => m.Ordering).ToListAsync(), i => (i as Modifier)?.ModId);
|
||||||
ControlUtils.RenewItemsSource(DeliveryPartList, d.Parts.OrderBy(p => p.DPNr).ToList(), i => ((i as DeliveryPart)?.Year, (i as DeliveryPart)?.DId, (i as DeliveryPart)?.DPNr), DeliveryPartList_SelectionChanged, ControlUtils.RenewSourceDefault.First);
|
ControlUtils.RenewItemsSource(DeliveryPartList, d.FilteredParts.OrderBy(p => p.DPNr).ToList(), i => ((i as DeliveryPart)?.Year, (i as DeliveryPart)?.DId, (i as DeliveryPart)?.DPNr), DeliveryPartList_SelectionChanged, ControlUtils.RenewSourceDefault.First);
|
||||||
} else {
|
} else {
|
||||||
ControlUtils.RenewItemsSource(ModifiersInput, await Context.Modifiers.Where(m => m.Year == Utils.CurrentLastSeason).OrderBy(m => m.Ordering).ToListAsync(), i => (i as Modifier)?.ModId);
|
ControlUtils.RenewItemsSource(ModifiersInput, await Context.Modifiers.Where(m => m.Year == Utils.CurrentLastSeason).OrderBy(m => m.Ordering).ToListAsync(), i => (i as Modifier)?.ModId);
|
||||||
DeliveryPartList.ItemsSource = null;
|
DeliveryPartList.ItemsSource = null;
|
||||||
@@ -1134,7 +1155,7 @@ namespace Elwig.Windows {
|
|||||||
} else {
|
} else {
|
||||||
// switch to last delivery part
|
// switch to last delivery part
|
||||||
DeliveryPartList.IsEnabled = true;
|
DeliveryPartList.IsEnabled = true;
|
||||||
DeliveryPartList.SelectedItem = d.Parts.Last();
|
DeliveryPartList.SelectedItem = d.FilteredParts.Last();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ namespace Elwig.Dialogs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<Member> list = await members.ToListAsync();
|
IEnumerable<Member> list = await members.ToListAsync();
|
||||||
var data = await DeliveryConfirmationData.ForSeason(Context.DeliveryParts, Year);
|
var data = await DeliveryConfirmationDeliveryData.ForSeason(Context.DeliveryParts, Year);
|
||||||
using var doc = Document.Merge(list.Select(m =>
|
using var doc = Document.Merge(list.Select(m =>
|
||||||
new DeliveryConfirmation(Context, Year, m, data.TryGetValue(m.MgNr, out var d) ? d : DeliveryConfirmationData.CreateEmpty(Year, m)) {
|
new DeliveryConfirmation(Context, Year, m, data.TryGetValue(m.MgNr, out var d) ? d : DeliveryConfirmationDeliveryData.CreateEmpty(Year, m)) {
|
||||||
//DoubleSided = true
|
//DoubleSided = true
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -27,11 +27,6 @@ namespace Elwig.Windows {
|
|||||||
w.Show();
|
w.Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MemberListButton_Click(object sender, RoutedEventArgs evt) {
|
|
||||||
var w = new MemberListWindow();
|
|
||||||
w.Show();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ReceiptButton_Click(object sender, RoutedEventArgs evt) {
|
private void ReceiptButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
App.FocusReceipt();
|
App.FocusReceipt();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
x:Class="Elwig.Windows.MemberAdminWindow"
|
x:Class="Elwig.Windows.MemberAdminWindow"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:Elwig.Windows"
|
xmlns:local="clr-namespace:Elwig.Windows"
|
||||||
Title="Mitglieder - Elwig" Height="700" Width="1250" MinHeight="650" MinWidth="1150"
|
Title="Mitglieder - Elwig" Height="700" Width="1250" MinHeight="650" MinWidth="1150"
|
||||||
Loaded="Window_Loaded">
|
Loaded="Window_Loaded">
|
||||||
@@ -239,14 +237,42 @@
|
|||||||
<ColumnDefinition Width="2*"/>
|
<ColumnDefinition Width="2*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<Label Content="E-Mail-Adresse (1):" Margin="10,10,0,0" Grid.Column="0"/>
|
<Label x:Name="EmailAddress1Label" Content="E-Mail-Adresse:" Margin="10,10,0,0" Grid.Column="0"/>
|
||||||
<TextBox x:Name="EmailAddress1Input" Margin="0,10,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
<TextBox x:Name="EmailAddress1Input" Margin="0,10,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
<Label Content="E-Mail-Adresse (2):" Margin="10,40,0,0" Grid.Column="0"/>
|
<Label x:Name="EmailAddress2Label" Content="E-Mail-Adresse:" Margin="10,40,0,0" Grid.Column="0"/>
|
||||||
<TextBox x:Name="EmailAddress2Input" Margin="0,40,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
<TextBox x:Name="EmailAddress2Input" Margin="0,40,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
|
<Label x:Name="EmailAddress3Label" Content="E-Mail-Adresse:" Margin="10,70,0,0" Grid.Column="0"/>
|
||||||
|
<TextBox x:Name="EmailAddress3Input" Margin="0,70,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
|
<Label x:Name="EmailAddress4Label" Content="E-Mail-Adresse:" Margin="10,100,0,0" Grid.Column="0"/>
|
||||||
|
<TextBox x:Name="EmailAddress4Input" Margin="0,100,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
|
<Label x:Name="EmailAddress5Label" Content="E-Mail-Adresse:" Margin="10,130,0,0" Grid.Column="0"/>
|
||||||
|
<TextBox x:Name="EmailAddress5Input" Margin="0,130,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
|
<Label x:Name="EmailAddress6Label" Content="E-Mail-Adresse:" Margin="10,160,0,0" Grid.Column="0"/>
|
||||||
|
<TextBox x:Name="EmailAddress6Input" Margin="0,160,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
|
<Label x:Name="EmailAddress7Label" Content="E-Mail-Adresse:" Margin="10,190,0,0" Grid.Column="0"/>
|
||||||
|
<TextBox x:Name="EmailAddress7Input" Margin="0,190,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
|
<Label x:Name="EmailAddress8Label" Content="E-Mail-Adresse:" Margin="10,210,0,0" Grid.Column="0"/>
|
||||||
|
<TextBox x:Name="EmailAddress8Input" Margin="0,210,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
|
<Label x:Name="EmailAddress9Label" Content="E-Mail-Adresse:" Margin="10,250,0,0" Grid.Column="0"/>
|
||||||
|
<TextBox x:Name="EmailAddress9Input" Margin="0,250,10,0" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
|
TextChanged="EmailAddressInput_TextChanged" LostFocus="EmailAddressInput_LostFocus"/>
|
||||||
|
|
||||||
<ComboBox x:Name="PhoneNr1TypeInput" DisplayMemberPath="Value" Margin="6,70,5,0" FontSize="12" Padding="6,4,4,4"/>
|
<ComboBox x:Name="PhoneNr1TypeInput" DisplayMemberPath="Value" Margin="6,70,5,0" FontSize="12" Padding="6,4,4,4"/>
|
||||||
<TextBox x:Name="PhoneNr1Input" Margin="0,70,5,0" Grid.Column="1"
|
<TextBox x:Name="PhoneNr1Input" Margin="0,70,5,0" Grid.Column="1"
|
||||||
TextChanged="PhoneNrInput_TextChanged" LostFocus="PhoneNrInput_LostFocus"/>
|
TextChanged="PhoneNrInput_TextChanged" LostFocus="PhoneNrInput_LostFocus"/>
|
||||||
|
|||||||
@@ -17,15 +17,20 @@ namespace Elwig.Windows {
|
|||||||
public partial class MemberAdminWindow : AdministrationWindow {
|
public partial class MemberAdminWindow : AdministrationWindow {
|
||||||
|
|
||||||
private List<string> TextFilter = [];
|
private List<string> TextFilter = [];
|
||||||
private readonly RoutedCommand CtrlF = new();
|
private readonly (ComboBox Type, TextBox Number, TextBox Comment)[] PhoneNrInputs;
|
||||||
private readonly (ComboBox, TextBox, TextBox)[] PhoneNrInputs;
|
private readonly (Label Label, TextBox Address)[] EmailAddressInputs;
|
||||||
|
|
||||||
|
private readonly RoutedCommand CtrlF = new("CtrlF", typeof(MemberAdminWindow), [new KeyGesture(Key.F, ModifierKeys.Control)]);
|
||||||
|
private readonly RoutedCommand CtrlP = new("CtrlP", typeof(MemberAdminWindow), [new KeyGesture(Key.P, ModifierKeys.Control)]);
|
||||||
|
private readonly RoutedCommand CtrlShiftP = new("CtrlShiftP", typeof(MemberAdminWindow), [new KeyGesture(Key.P, ModifierKeys.Control | ModifierKeys.Shift)]);
|
||||||
|
|
||||||
private static ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
|
private static ObservableCollection<KeyValuePair<string, string>> PhoneNrTypes { get; set; } = new(Utils.PhoneNrTypes);
|
||||||
|
|
||||||
public MemberAdminWindow() {
|
public MemberAdminWindow() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
CtrlF.InputGestures.Add(new KeyGesture(Key.F, ModifierKeys.Control));
|
|
||||||
CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput));
|
CommandBindings.Add(new CommandBinding(CtrlF, FocusSearchInput));
|
||||||
|
CommandBindings.Add(new CommandBinding(CtrlP, Menu_Show_MemberDataSheet_Click));
|
||||||
|
CommandBindings.Add(new CommandBinding(CtrlShiftP, Menu_Print_MemberDataSheet_Click));
|
||||||
ExemptInputs = [
|
ExemptInputs = [
|
||||||
SearchInput, ActiveMemberInput, MemberList,
|
SearchInput, ActiveMemberInput, MemberList,
|
||||||
];
|
];
|
||||||
@@ -34,6 +39,17 @@ namespace Elwig.Windows {
|
|||||||
AddressInput, PlzInput, OrtInput, BillingOrtInput,
|
AddressInput, PlzInput, OrtInput, BillingOrtInput,
|
||||||
BusinessSharesInput, BranchInput, DefaultKgInput
|
BusinessSharesInput, BranchInput, DefaultKgInput
|
||||||
];
|
];
|
||||||
|
EmailAddressInputs = [
|
||||||
|
(EmailAddress1Label, EmailAddress1Input),
|
||||||
|
(EmailAddress2Label, EmailAddress2Input),
|
||||||
|
(EmailAddress3Label, EmailAddress3Input),
|
||||||
|
(EmailAddress4Label, EmailAddress4Input),
|
||||||
|
(EmailAddress5Label, EmailAddress5Input),
|
||||||
|
(EmailAddress6Label, EmailAddress6Input),
|
||||||
|
(EmailAddress7Label, EmailAddress7Input),
|
||||||
|
(EmailAddress8Label, EmailAddress8Input),
|
||||||
|
(EmailAddress9Label, EmailAddress9Input),
|
||||||
|
];
|
||||||
PhoneNrInputs = [
|
PhoneNrInputs = [
|
||||||
(PhoneNr1TypeInput, PhoneNr1Input, PhoneNr1CommentInput),
|
(PhoneNr1TypeInput, PhoneNr1Input, PhoneNr1CommentInput),
|
||||||
(PhoneNr2TypeInput, PhoneNr2Input, PhoneNr2CommentInput),
|
(PhoneNr2TypeInput, PhoneNr2Input, PhoneNr2CommentInput),
|
||||||
@@ -59,7 +75,7 @@ namespace Elwig.Windows {
|
|||||||
Menu_Print_MemberDataSheet.IsEnabled = App.IsPrintingReady;
|
Menu_Print_MemberDataSheet.IsEnabled = App.IsPrintingReady;
|
||||||
|
|
||||||
ActiveMemberInput.IsChecked = true;
|
ActiveMemberInput.IsChecked = true;
|
||||||
UpdatePhoneNrInputVisibility();
|
UpdateContactInfoVisibility();
|
||||||
LockInputs();
|
LockInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -232,27 +248,55 @@ namespace Elwig.Windows {
|
|||||||
|
|
||||||
private void SetPhoneNrInput(int nr, string? type, string? number, string? comment) {
|
private void SetPhoneNrInput(int nr, string? type, string? number, string? comment) {
|
||||||
var inputs = PhoneNrInputs[nr];
|
var inputs = PhoneNrInputs[nr];
|
||||||
inputs.Item1.SelectedItem = (type == null) ? null : inputs.Item1.ItemsSource.Cast<KeyValuePair<string, string>>().FirstOrDefault(p => p.Key == type);
|
inputs.Type.SelectedItem = (type == null) ? null : inputs.Type.ItemsSource.Cast<KeyValuePair<string, string>>().FirstOrDefault(p => p.Key == type);
|
||||||
inputs.Item2.Text = number;
|
inputs.Number.Text = number;
|
||||||
inputs.Item3.Text = comment;
|
inputs.Comment.Text = comment;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetEmailAddressInput(int nr, string? address) {
|
||||||
|
var inputs = EmailAddressInputs[nr];
|
||||||
|
inputs.Address.Text = address;
|
||||||
}
|
}
|
||||||
|
|
||||||
private (string, string, string?)? GetPhoneNrInput(int nr) {
|
private (string, string, string?)? GetPhoneNrInput(int nr) {
|
||||||
var inputs = PhoneNrInputs[nr];
|
var inputs = PhoneNrInputs[nr];
|
||||||
var number = inputs.Item2.Text;
|
var number = inputs.Number.Text;
|
||||||
if (string.IsNullOrEmpty(number))
|
if (string.IsNullOrEmpty(number))
|
||||||
return null;
|
return null;
|
||||||
var type = (inputs.Item1.SelectedItem as KeyValuePair<string, string>?)?.Key ?? (number.StartsWith("+43 ") && number[4] == '6' ? "mobile" : "landline");
|
var type = (inputs.Type.SelectedItem as KeyValuePair<string, string>?)?.Key ?? (number.StartsWith("+43 ") && number[4] == '6' ? "mobile" : "landline");
|
||||||
var comment = inputs.Item3.Text;
|
var comment = inputs.Comment.Text;
|
||||||
return (type, number, comment == "" ? null : comment);
|
return (type, number, comment == "" ? null : comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetPhoneNrInputVisible(int nr, bool visible) {
|
private string? GetEmailAddressInput(int nr) {
|
||||||
|
var inputs = EmailAddressInputs[nr];
|
||||||
|
return inputs.Address.Text == "" ? null : inputs.Address.Text;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetPhoneNrInputVisible(int nr, bool visible, int? position = null) {
|
||||||
var inputs = PhoneNrInputs[nr];
|
var inputs = PhoneNrInputs[nr];
|
||||||
|
if (position is int p) {
|
||||||
|
var mt = 10 + p * 30;
|
||||||
|
inputs.Type.Margin = new(6, mt, 5, 0);
|
||||||
|
inputs.Number.Margin = new(0, mt, 5, 0);
|
||||||
|
inputs.Comment.Margin = new(0, mt, 10, 0);
|
||||||
|
}
|
||||||
var vis = visible ? Visibility.Visible : Visibility.Hidden;
|
var vis = visible ? Visibility.Visible : Visibility.Hidden;
|
||||||
inputs.Item1.Visibility = vis;
|
inputs.Type.Visibility = vis;
|
||||||
inputs.Item2.Visibility = vis;
|
inputs.Number.Visibility = vis;
|
||||||
inputs.Item3.Visibility = vis;
|
inputs.Comment.Visibility = vis;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SetEmailAddressInputVisible(int nr, bool visible, int? position = null) {
|
||||||
|
var inputs = EmailAddressInputs[nr];
|
||||||
|
if (position is int p) {
|
||||||
|
var mt = 10 + p * 30;
|
||||||
|
inputs.Label.Margin = new(10, mt, 0, 0);
|
||||||
|
inputs.Address.Margin = new(0, mt, 10, 0);
|
||||||
|
}
|
||||||
|
var vis = visible ? Visibility.Visible : Visibility.Hidden;
|
||||||
|
inputs.Label.Visibility = vis;
|
||||||
|
inputs.Address.Visibility = vis;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MemberList_SelectionChanged(object sender, RoutedEventArgs evt) {
|
private void MemberList_SelectionChanged(object sender, RoutedEventArgs evt) {
|
||||||
@@ -270,7 +314,7 @@ namespace Elwig.Windows {
|
|||||||
HideNewEditDeleteButtons();
|
HideNewEditDeleteButtons();
|
||||||
ShowSaveResetCancelButtons();
|
ShowSaveResetCancelButtons();
|
||||||
UnlockInputs();
|
UnlockInputs();
|
||||||
UpdatePhoneNrInputVisibility(true);
|
UpdateContactInfoVisibility(true);
|
||||||
InitInputs();
|
InitInputs();
|
||||||
LockSearchInputs();
|
LockSearchInputs();
|
||||||
}
|
}
|
||||||
@@ -285,7 +329,7 @@ namespace Elwig.Windows {
|
|||||||
HideNewEditDeleteButtons();
|
HideNewEditDeleteButtons();
|
||||||
ShowSaveResetCancelButtons();
|
ShowSaveResetCancelButtons();
|
||||||
UnlockInputs();
|
UnlockInputs();
|
||||||
UpdatePhoneNrInputVisibility(true);
|
UpdateContactInfoVisibility(true);
|
||||||
LockSearchInputs();
|
LockSearchInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +355,7 @@ namespace Elwig.Windows {
|
|||||||
HideSaveResetCancelButtons();
|
HideSaveResetCancelButtons();
|
||||||
ShowNewEditDeleteButtons();
|
ShowNewEditDeleteButtons();
|
||||||
LockInputs();
|
LockInputs();
|
||||||
UpdatePhoneNrInputVisibility();
|
UpdateContactInfoVisibility();
|
||||||
UnlockSearchInputs();
|
UnlockSearchInputs();
|
||||||
FinishInputFilling();
|
FinishInputFilling();
|
||||||
await RefreshMemberList();
|
await RefreshMemberList();
|
||||||
@@ -338,7 +382,7 @@ namespace Elwig.Windows {
|
|||||||
ShowNewEditDeleteButtons();
|
ShowNewEditDeleteButtons();
|
||||||
RefreshInputs();
|
RefreshInputs();
|
||||||
LockInputs();
|
LockInputs();
|
||||||
UpdatePhoneNrInputVisibility();
|
UpdateContactInfoVisibility();
|
||||||
UnlockSearchInputs();
|
UnlockSearchInputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,13 +544,24 @@ namespace Elwig.Windows {
|
|||||||
ActiveMemberInput.IsEnabled = true;
|
ActiveMemberInput.IsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdatePhoneNrInputVisibility(bool extra = false) {
|
private void UpdateContactInfoVisibility(bool extra = false) {
|
||||||
bool lastVisible = true;
|
var m = MemberList.SelectedItem as Member;
|
||||||
var m = (Member)MemberList.SelectedItem;
|
bool lastVisible;
|
||||||
|
int num = 0;
|
||||||
|
lastVisible = true;
|
||||||
|
for (int i = 0; i < EmailAddressInputs.Length; i++) {
|
||||||
|
var input = EmailAddressInputs[i];
|
||||||
|
var vis = !string.IsNullOrEmpty(input.Address.Text) || (m?.EmailAddresses.Any(a => a.Nr - 1 == i) ?? false);
|
||||||
|
var cVis = vis || (extra && lastVisible);
|
||||||
|
SetEmailAddressInputVisible(i, cVis, cVis ? num++ : null);
|
||||||
|
lastVisible = vis;
|
||||||
|
}
|
||||||
|
lastVisible = true;
|
||||||
for (int i = 0; i < PhoneNrInputs.Length; i++) {
|
for (int i = 0; i < PhoneNrInputs.Length; i++) {
|
||||||
var input = PhoneNrInputs[i];
|
var input = PhoneNrInputs[i];
|
||||||
var vis = !string.IsNullOrEmpty(input.Item2.Text) || (m?.TelephoneNumbers.Any(p => p.Nr - 1 == i) ?? false);
|
var vis = !string.IsNullOrEmpty(input.Number.Text) || (m?.TelephoneNumbers.Any(n => n.Nr - 1 == i) ?? false);
|
||||||
SetPhoneNrInputVisible(i, vis || (extra && lastVisible));
|
var cVis = vis || (extra && lastVisible);
|
||||||
|
SetPhoneNrInputVisible(i, cVis, cVis ? num++ : null);
|
||||||
lastVisible = vis;
|
lastVisible = vis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -601,17 +656,17 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < EmailAddressInputs.Length; i++) {
|
||||||
var input = i == 0 ? EmailAddress1Input : EmailAddress2Input;
|
var input = GetEmailAddressInput(i);
|
||||||
var emailAddr = m.EmailAddresses.FirstOrDefault(a => a.Nr - 1 == i);
|
var emailAddr = m.EmailAddresses.FirstOrDefault(a => a.Nr - 1 == i);
|
||||||
if (input.Text == "") {
|
if (input == null || input == "") {
|
||||||
if (emailAddr != null) {
|
if (emailAddr != null) {
|
||||||
Context.Remove(emailAddr);
|
Context.Remove(emailAddr);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
MemberEmailAddr a = emailAddr ?? Context.CreateProxy<MemberEmailAddr>();
|
MemberEmailAddr a = emailAddr ?? Context.CreateProxy<MemberEmailAddr>();
|
||||||
a.Nr = i + 1;
|
a.Nr = i + 1;
|
||||||
a.Address = input.Text;
|
a.Address = input ?? "";
|
||||||
a.Comment = null;
|
a.Comment = null;
|
||||||
if (emailAddr == null) {
|
if (emailAddr == null) {
|
||||||
a.MgNr = newMgNr;
|
a.MgNr = newMgNr;
|
||||||
@@ -674,8 +729,14 @@ namespace Elwig.Windows {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var emailAddrs = m.EmailAddresses.OrderBy(a => a.Nr).ToList();
|
var emailAddrs = m.EmailAddresses.OrderBy(a => a.Nr).ToList();
|
||||||
EmailAddress1Input.Text = emailAddrs.Count > 0 ? emailAddrs[0].Address : "";
|
for (int i = 0; i< EmailAddressInputs.Length; i++) {
|
||||||
EmailAddress2Input.Text = emailAddrs.Count > 1 ? emailAddrs[1].Address : "";
|
if (i < emailAddrs.Count) {
|
||||||
|
var emailAddr = emailAddrs[i];
|
||||||
|
SetEmailAddressInput(i, emailAddr.Address);
|
||||||
|
} else {
|
||||||
|
SetEmailAddressInput(i, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var phoneNrs = m.TelephoneNumbers.OrderBy(p => p.Nr).ToList();
|
var phoneNrs = m.TelephoneNumbers.OrderBy(p => p.Nr).ToList();
|
||||||
for (int i = 0; i < PhoneNrInputs.Length; i++) {
|
for (int i = 0; i < PhoneNrInputs.Length; i++) {
|
||||||
@@ -686,7 +747,7 @@ namespace Elwig.Windows {
|
|||||||
SetPhoneNrInput(i, null, null, null);
|
SetPhoneNrInput(i, null, null, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
UpdatePhoneNrInputVisibility(IsEditing || IsCreating);
|
UpdateContactInfoVisibility(IsEditing || IsCreating);
|
||||||
|
|
||||||
IbanInput.Text = m.Iban;
|
IbanInput.Text = m.Iban;
|
||||||
BicInput.Text = m.Bic;
|
BicInput.Text = m.Bic;
|
||||||
@@ -782,9 +843,14 @@ namespace Elwig.Windows {
|
|||||||
InputLostFocus((TextBox)sender, Validator.CheckPredecessorMgNr);
|
InputLostFocus((TextBox)sender, Validator.CheckPredecessorMgNr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private new void EmailAddressInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||||
|
base.EmailAddressInput_TextChanged(sender, evt);
|
||||||
|
UpdateContactInfoVisibility(IsEditing || IsCreating);
|
||||||
|
}
|
||||||
|
|
||||||
private new void PhoneNrInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
private new void PhoneNrInput_TextChanged(object sender, TextChangedEventArgs evt) {
|
||||||
base.PhoneNrInput_TextChanged(sender, evt);
|
base.PhoneNrInput_TextChanged(sender, evt);
|
||||||
UpdatePhoneNrInputVisibility(IsEditing || IsCreating);
|
UpdateContactInfoVisibility(IsEditing || IsCreating);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void KgDetailsButton_Click(object sender, RoutedEventArgs evt) {
|
private void KgDetailsButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
<Window x:Class="Elwig.Windows.MemberListWindow"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:Elwig.Windows"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="Mitgliederliste - Elwig" Height="450" Width="800">
|
|
||||||
<Grid>
|
|
||||||
<DataGrid x:Name="MemberList" AutoGenerateColumns="False" HeadersVisibility="Column" IsReadOnly="True" GridLinesVisibility="None" SelectionMode="Single"
|
|
||||||
CanUserDeleteRows="False" CanUserResizeRows="False" CanUserAddRows="False" FontSize="14">
|
|
||||||
<DataGrid.Columns>
|
|
||||||
<DataGridTextColumn Header="MgNr." Binding="{Binding MgNr}" Width="70"/>
|
|
||||||
<DataGridTextColumn Header="Präfix" Binding="{Binding Prefix}" Width="100"/>
|
|
||||||
<DataGridTextColumn Header="Vorname" Binding="{Binding GivenName}" Width="100"/>
|
|
||||||
<DataGridTextColumn Header="Weitere Namen" Binding="{Binding MiddleName}" Width="100"/>
|
|
||||||
<DataGridTextColumn Header="Nachname" Binding="{Binding FamilyName}" Width="100"/>
|
|
||||||
<DataGridTextColumn Header="Suffix" Binding="{Binding Suffix}" Width="100"/>
|
|
||||||
</DataGrid.Columns>
|
|
||||||
</DataGrid>
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
using Elwig.Helpers;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace Elwig.Windows {
|
|
||||||
public partial class MemberListWindow : Window {
|
|
||||||
private readonly AppDbContext Context = new();
|
|
||||||
|
|
||||||
public MemberListWindow() {
|
|
||||||
InitializeComponent();
|
|
||||||
MemberList.ItemsSource = Context.Members.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:Elwig.Windows"
|
xmlns:local="clr-namespace:Elwig.Windows"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Auszahlungsvarianten - Elwig" Height="500" Width="820" MinHeight="500" MinWidth="820">
|
Title="Auszahlungsvarianten - Elwig" Height="510" Width="820" MinHeight="500" MinWidth="820">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<Style TargetType="Label">
|
<Style TargetType="Label">
|
||||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height="200"/>
|
<RowDefinition Height="220"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<ListBox x:Name="PaymentVariantList" Margin="10,10,35,10" Grid.RowSpan="2" SelectionChanged="PaymentVariantList_SelectionChanged">
|
<ListBox x:Name="PaymentVariantList" Margin="10,10,35,10" Grid.RowSpan="2" SelectionChanged="PaymentVariantList_SelectionChanged">
|
||||||
@@ -163,6 +163,9 @@
|
|||||||
<Button x:Name="ExportButton" Content="Exportieren" FontSize="14" Width="180" Margin="10,10,10,10" Height="27" IsEnabled="False"
|
<Button x:Name="ExportButton" Content="Exportieren" FontSize="14" Width="180" Margin="10,10,10,10" Height="27" IsEnabled="False"
|
||||||
Click="ExportButton_Click"
|
Click="ExportButton_Click"
|
||||||
VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
||||||
|
<Button x:Name="TransactionButton" Content="Buchungsliste" FontSize="14" Width="180" Margin="10,42,10,10" Height="27" IsEnabled="False"
|
||||||
|
Click="TransactionButton_Click"
|
||||||
|
VerticalAlignment="Top" HorizontalAlignment="Left"/>
|
||||||
|
|
||||||
<ProgressBar x:Name="ProgressBar" Margin="10,10,10,74" Height="27" Width="180"
|
<ProgressBar x:Name="ProgressBar" Margin="10,10,10,74" Height="27" Width="180"
|
||||||
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
|
VerticalAlignment="Bottom" HorizontalAlignment="Left"/>
|
||||||
|
|||||||
@@ -52,9 +52,12 @@ namespace Elwig.Windows {
|
|||||||
Arrow3.Content = locked ? "\xF0B0" : "\xF0AF";
|
Arrow3.Content = locked ? "\xF0B0" : "\xF0AF";
|
||||||
CopyButton.IsEnabled = true;
|
CopyButton.IsEnabled = true;
|
||||||
EditButton.Content = locked ? "Ansehen" : "Bearbeiten";
|
EditButton.Content = locked ? "Ansehen" : "Bearbeiten";
|
||||||
|
EditButton.IsEnabled = true;
|
||||||
|
SaveButton.IsEnabled = !locked;
|
||||||
ShowButton.IsEnabled = true;
|
ShowButton.IsEnabled = true;
|
||||||
PrintButton.IsEnabled = true;
|
PrintButton.IsEnabled = true;
|
||||||
ExportButton.IsEnabled = locked;
|
ExportButton.IsEnabled = locked;
|
||||||
|
TransactionButton.IsEnabled = locked;
|
||||||
|
|
||||||
NameInput.Text = v.Name;
|
NameInput.Text = v.Name;
|
||||||
NameInput.IsReadOnly = false;
|
NameInput.IsReadOnly = false;
|
||||||
@@ -67,30 +70,27 @@ namespace Elwig.Windows {
|
|||||||
try {
|
try {
|
||||||
BillingData = BillingData.FromJson(v.Data);
|
BillingData = BillingData.FromJson(v.Data);
|
||||||
ConsiderModifiersInput.IsChecked = BillingData.ConsiderDelieryModifiers;
|
ConsiderModifiersInput.IsChecked = BillingData.ConsiderDelieryModifiers;
|
||||||
ConsiderModifiersInput.IsEnabled = !locked;
|
|
||||||
ConsiderPenaltiesInput.IsChecked = BillingData.ConsiderContractPenalties;
|
ConsiderPenaltiesInput.IsChecked = BillingData.ConsiderContractPenalties;
|
||||||
ConsiderPenaltiesInput.IsEnabled = !locked;
|
|
||||||
ConsiderPenaltyInput.IsChecked = BillingData.ConsiderTotalPenalty;
|
ConsiderPenaltyInput.IsChecked = BillingData.ConsiderTotalPenalty;
|
||||||
ConsiderPenaltyInput.IsEnabled = !locked;
|
|
||||||
ConsiderAutoInput.IsChecked = BillingData.ConsiderAutoBusinessShares;
|
ConsiderAutoInput.IsChecked = BillingData.ConsiderAutoBusinessShares;
|
||||||
ConsiderAutoInput.IsEnabled = !locked;
|
|
||||||
DataInput.Text = JsonSerializer.Serialize(BillingData.Data, JsonOpt);
|
DataInput.Text = JsonSerializer.Serialize(BillingData.Data, JsonOpt);
|
||||||
DataInput.IsReadOnly = locked;
|
|
||||||
} catch {
|
} catch {
|
||||||
BillingData = null;
|
BillingData = null;
|
||||||
ConsiderModifiersInput.IsChecked = false;
|
ConsiderModifiersInput.IsChecked = false;
|
||||||
ConsiderModifiersInput.IsEnabled = false;
|
|
||||||
ConsiderPenaltiesInput.IsChecked = false;
|
ConsiderPenaltiesInput.IsChecked = false;
|
||||||
ConsiderPenaltiesInput.IsEnabled = false;
|
|
||||||
ConsiderPenaltyInput.IsChecked = false;
|
ConsiderPenaltyInput.IsChecked = false;
|
||||||
ConsiderPenaltyInput.IsEnabled = false;
|
|
||||||
ConsiderAutoInput.IsChecked = false;
|
ConsiderAutoInput.IsChecked = false;
|
||||||
ConsiderAutoInput.IsEnabled = false;
|
|
||||||
DataInput.Text = v.Data;
|
DataInput.Text = v.Data;
|
||||||
DataInput.IsEnabled = false;
|
|
||||||
}
|
}
|
||||||
|
ConsiderModifiersInput.IsEnabled = !locked;
|
||||||
|
ConsiderPenaltiesInput.IsEnabled = !locked;
|
||||||
|
ConsiderPenaltyInput.IsEnabled = !locked;
|
||||||
|
ConsiderAutoInput.IsEnabled = !locked;
|
||||||
|
DataInput.IsReadOnly = locked;
|
||||||
} else {
|
} else {
|
||||||
EditButton.Content = "Bearbeiten";
|
EditButton.Content = "Bearbeiten";
|
||||||
|
EditButton.IsEnabled = false;
|
||||||
|
SaveButton.IsEnabled = false;
|
||||||
CopyButton.IsEnabled = false;
|
CopyButton.IsEnabled = false;
|
||||||
CalculateButton.IsEnabled = false;
|
CalculateButton.IsEnabled = false;
|
||||||
CommitButton.IsEnabled = false;
|
CommitButton.IsEnabled = false;
|
||||||
@@ -102,6 +102,7 @@ namespace Elwig.Windows {
|
|||||||
ShowButton.IsEnabled = false;
|
ShowButton.IsEnabled = false;
|
||||||
PrintButton.IsEnabled = false;
|
PrintButton.IsEnabled = false;
|
||||||
ExportButton.IsEnabled = false;
|
ExportButton.IsEnabled = false;
|
||||||
|
TransactionButton.IsEnabled = false;
|
||||||
|
|
||||||
BillingData = null;
|
BillingData = null;
|
||||||
NameInput.Text = "";
|
NameInput.Text = "";
|
||||||
@@ -130,11 +131,13 @@ namespace Elwig.Windows {
|
|||||||
private void UpdateSaveButton() {
|
private void UpdateSaveButton() {
|
||||||
SaveButton.IsEnabled = PaymentVariantList.SelectedItem != null &&
|
SaveButton.IsEnabled = PaymentVariantList.SelectedItem != null &&
|
||||||
((DataChanged && DataValid) || NameChanged || CommentChanged ||
|
((DataChanged && DataValid) || NameChanged || CommentChanged ||
|
||||||
(TransferDateChanged && TransferDateValid)) ||
|
(TransferDateChanged && TransferDateValid) ||
|
||||||
(ConsiderModifiersInput.IsChecked != BillingData?.ConsiderDelieryModifiers) ||
|
(ConsiderModifiersInput.IsChecked != BillingData?.ConsiderDelieryModifiers) ||
|
||||||
(ConsiderPenaltiesInput.IsChecked != BillingData?.ConsiderContractPenalties) ||
|
(ConsiderPenaltiesInput.IsChecked != BillingData?.ConsiderContractPenalties) ||
|
||||||
(ConsiderPenaltyInput.IsChecked != BillingData?.ConsiderTotalPenalty) ||
|
(ConsiderPenaltyInput.IsChecked != BillingData?.ConsiderTotalPenalty) ||
|
||||||
(ConsiderAutoInput.IsChecked != BillingData?.ConsiderAutoBusinessShares);
|
(ConsiderAutoInput.IsChecked != BillingData?.ConsiderAutoBusinessShares));
|
||||||
|
CalculateButton.IsEnabled = !SaveButton.IsEnabled && PaymentVariantList.SelectedItem is PaymentVar { TestVariant: true };
|
||||||
|
CommitButton.IsEnabled = CalculateButton.IsEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateSums() {
|
private void UpdateSums() {
|
||||||
@@ -173,7 +176,7 @@ namespace Elwig.Windows {
|
|||||||
v.Name = "Neue Auszahlungsvariante";
|
v.Name = "Neue Auszahlungsvariante";
|
||||||
v.TestVariant = true;
|
v.TestVariant = true;
|
||||||
v.DateString = $"{DateTime.Today:yyyy-MM-dd}";
|
v.DateString = $"{DateTime.Today:yyyy-MM-dd}";
|
||||||
v.Data = "{\"mode\": \"elwig\", \"version\": 1, \"payment\": 1.0, \"curves\": []}";
|
v.Data = "{\"mode\": \"elwig\", \"version\": 1, \"payment\": {}, \"curves\": []}";
|
||||||
|
|
||||||
await Context.AddAsync(v);
|
await Context.AddAsync(v);
|
||||||
await Context.SaveChangesAsync();
|
await Context.SaveChangesAsync();
|
||||||
@@ -283,9 +286,9 @@ namespace Elwig.Windows {
|
|||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
var b = new BillingVariant(v.Year, v.AvNr);
|
var b = new BillingVariant(v.Year, v.AvNr);
|
||||||
await b.Revert();
|
await b.Revert();
|
||||||
|
await App.HintContextChange();
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
CommitButton.IsEnabled = true;
|
CommitButton.IsEnabled = true;
|
||||||
await App.HintContextChange();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void ExportButton_Click(object sender, RoutedEventArgs evt) {
|
private async void ExportButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
@@ -304,13 +307,42 @@ namespace Elwig.Windows {
|
|||||||
if (d.ShowDialog() == true) {
|
if (d.ShowDialog() == true) {
|
||||||
ExportButton.IsEnabled = false;
|
ExportButton.IsEnabled = false;
|
||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
using var e = new Ebics(v, d.FileName);
|
try {
|
||||||
await e.ExportAsync(Transaction.FromPaymentVariant(v));
|
using var e = new Ebics(v, d.FileName, 9);
|
||||||
|
await e.ExportAsync(Transaction.FromPaymentVariant(v));
|
||||||
|
} catch (Exception exc) {
|
||||||
|
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
ExportButton.IsEnabled = true;
|
ExportButton.IsEnabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void TransactionButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
|
if (PaymentVariantList.SelectedValue is not PaymentVar v) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var d = new SaveFileDialog() {
|
||||||
|
FileName = $"{App.Client.NameToken}-Buchungsliste-{v.Year}-{v.Name.Trim().Replace(' ', '-')}.ods",
|
||||||
|
DefaultExt = "ods",
|
||||||
|
Filter = "OpenDocument Format Spreadsheet (*.ods)|*.ods",
|
||||||
|
Title = $"Buchungsliste speichern unter - Elwig"
|
||||||
|
};
|
||||||
|
if (d.ShowDialog() == true) {
|
||||||
|
TransactionButton.IsEnabled = false;
|
||||||
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
|
try {
|
||||||
|
var tbl = await CreditNoteData.ForPaymentVariant(Context, v.Year, v.AvNr);
|
||||||
|
using var ods = new OdsFile(d.FileName);
|
||||||
|
await ods.AddTable(tbl);
|
||||||
|
} catch (Exception exc) {
|
||||||
|
MessageBox.Show(exc.Message, "Fehler", MessageBoxButton.OK, MessageBoxImage.Error);
|
||||||
|
}
|
||||||
|
Mouse.OverrideCursor = null;
|
||||||
|
TransactionButton.IsEnabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async void SaveButton_Click(object sender, RoutedEventArgs evt) {
|
private async void SaveButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
if (PaymentVariantList.SelectedItem is not PaymentVar v || BillingData == null) return;
|
if (PaymentVariantList.SelectedItem is not PaymentVar v || BillingData == null) return;
|
||||||
try {
|
try {
|
||||||
@@ -488,11 +520,19 @@ namespace Elwig.Windows {
|
|||||||
members = members.OrderBy(m => m.MgNr);
|
members = members.OrderBy(m => m.MgNr);
|
||||||
|
|
||||||
IEnumerable<Member> list = await members.ToListAsync();
|
IEnumerable<Member> list = await members.ToListAsync();
|
||||||
var data = await CreditNoteData.ForPaymentVariant(Context.CreditNoteRows, Context.Seasons, v.Year, v.AvNr);
|
var data = await CreditNoteDeliveryData.ForPaymentVariant(Context.CreditNoteDeliveryRows, Context.Seasons, v.Year, v.AvNr);
|
||||||
var payments = await Context.MemberPayments.Where(p => p.Year == v.Year && p.AvNr == v.AvNr).ToDictionaryAsync(c => c.MgNr);
|
var payments = await Context.MemberPayments.Where(p => p.Year == v.Year && p.AvNr == v.AvNr).ToDictionaryAsync(c => c.MgNr);
|
||||||
await Context.GetMemberAreaCommitmentBuckets(Year, 0);
|
await Context.GetMemberAreaCommitmentBuckets(Year, 0);
|
||||||
using var doc = Document.Merge(list.Select(m =>
|
using var doc = Document.Merge(list.Select(m =>
|
||||||
new CreditNote(Context, payments[m.MgNr], data[m.MgNr], Context.GetMemberUnderDelivery(Year, m.MgNr).GetAwaiter().GetResult())
|
new CreditNote(
|
||||||
|
Context,
|
||||||
|
payments[m.MgNr],
|
||||||
|
data[m.MgNr],
|
||||||
|
BillingData?.ConsiderContractPenalties ?? false,
|
||||||
|
BillingData?.ConsiderTotalPenalty ?? false,
|
||||||
|
BillingData?.ConsiderAutoBusinessShares ?? false,
|
||||||
|
Context.GetMemberUnderDelivery(Year, m.MgNr).GetAwaiter().GetResult()
|
||||||
|
)
|
||||||
));
|
));
|
||||||
await doc.Generate(new Progress<double>(v => {
|
await doc.Generate(new Progress<double>(v => {
|
||||||
ProgressBar.Value = v;
|
ProgressBar.Value = v;
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Elwig.Dialogs;
|
|
||||||
using Elwig.Helpers;
|
using Elwig.Helpers;
|
||||||
using Elwig.Helpers.Billing;
|
using Elwig.Helpers.Billing;
|
||||||
using Elwig.Helpers.Export;
|
using Elwig.Helpers.Export;
|
||||||
using Elwig.Models.Dtos;
|
using Elwig.Models.Dtos;
|
||||||
|
using Elwig.Models.Entities;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -33,19 +33,31 @@ namespace Elwig.Windows {
|
|||||||
OverUnderDeliveryButton.IsEnabled = valid;
|
OverUnderDeliveryButton.IsEnabled = valid;
|
||||||
AutoBusinessSharesButton.IsEnabled = valid;
|
AutoBusinessSharesButton.IsEnabled = valid;
|
||||||
PaymentButton.IsEnabled = valid;
|
PaymentButton.IsEnabled = valid;
|
||||||
|
AllowAttrIntoLowerInput.IsEnabled = valid && last;
|
||||||
|
AvoidUnderDeliveriesInput.IsEnabled = valid && last;
|
||||||
|
HonorGebundenInput.IsEnabled = valid && last;
|
||||||
|
AllowAttrIntoLowerInput.IsChecked = s0?.Billing_AllowAttrsIntoLower;
|
||||||
|
AvoidUnderDeliveriesInput.IsChecked = s0?.Billing_AvoidUnderDeliveries;
|
||||||
|
HonorGebundenInput.IsChecked = s0?.Billing_HonorGebunden;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void CalculateBucketsButton_Click(object sender, RoutedEventArgs evt) {
|
private async void CalculateBucketsButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
if (SeasonInput.Value is not int year)
|
if (SeasonInput.Value is not int year || await Context.Seasons.FindAsync(year) is not Season s)
|
||||||
return;
|
return;
|
||||||
CalculateBucketsButton.IsEnabled = false;
|
CalculateBucketsButton.IsEnabled = false;
|
||||||
Mouse.OverrideCursor = Cursors.AppStarting;
|
Mouse.OverrideCursor = Cursors.AppStarting;
|
||||||
|
|
||||||
|
try {
|
||||||
|
s.Billing_AllowAttrsIntoLower = AllowAttrIntoLowerInput.IsChecked ?? false;
|
||||||
|
s.Billing_AvoidUnderDeliveries = AvoidUnderDeliveriesInput.IsChecked ?? false;
|
||||||
|
s.Billing_HonorGebunden = HonorGebundenInput.IsChecked ?? false;
|
||||||
|
Context.Update(s);
|
||||||
|
await Context.SaveChangesAsync();
|
||||||
|
} catch { }
|
||||||
|
|
||||||
var b = new Billing(year);
|
var b = new Billing(year);
|
||||||
await b.FinishSeason();
|
await b.FinishSeason();
|
||||||
await b.CalculateBuckets(
|
await b.CalculateBuckets();
|
||||||
AllowAttrIntoLowerInput.IsChecked ?? false,
|
|
||||||
AvoidUnderDeliveriesInput.IsChecked ?? false,
|
|
||||||
HonorGebundenInput.IsChecked ?? false);
|
|
||||||
Mouse.OverrideCursor = null;
|
Mouse.OverrideCursor = null;
|
||||||
CalculateBucketsButton.IsEnabled = true;
|
CalculateBucketsButton.IsEnabled = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace Elwig.Windows {
|
|||||||
private async void ZipButton_Click(object sender, RoutedEventArgs evt) {
|
private async void ZipButton_Click(object sender, RoutedEventArgs evt) {
|
||||||
using var ctx = new AppDbContext();
|
using var ctx = new AppDbContext();
|
||||||
using var ods = new OdsFile(@"C:\Users\Lorenz\Desktop\test.ods");
|
using var ods = new OdsFile(@"C:\Users\Lorenz\Desktop\test.ods");
|
||||||
await ods.AddTable(await DeliveryConfirmationData.ForMember(ctx.DeliveryParts, 2023, ctx.Members.Find(2948)));
|
await ods.AddTable(await DeliveryConfirmationDeliveryData.ForMember(ctx.DeliveryParts, 2023, ctx.Members.Find(2948)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
::mkdir "C:\Program Files\Elwig"
|
::mkdir "C:\Program Files\Elwig"
|
||||||
::curl -s "http://www.columbia.edu/~em36/PDFtoPrinter.exe" -z "C:\Program Files\Elwig\PDFtoPrinter.exe" -o "C:\Program Files\Elwig\PDFtoPrinter.exe"
|
::curl -s -L "http://www.columbia.edu/~em36/PDFtoPrinter.exe" -z "C:\Program Files\Elwig\PDFtoPrinter.exe" -o "C:\Program Files\Elwig\PDFtoPrinter.exe"
|
||||||
mkdir "C:\ProgramData\Elwig\resources"
|
mkdir "C:\ProgramData\Elwig\resources"
|
||||||
copy /b /y Documents\*.css "C:\ProgramData\Elwig\resources"
|
copy /b /y Documents\*.css "C:\ProgramData\Elwig\resources"
|
||||||
copy /b /y Documents\*.cshtml "C:\ProgramData\Elwig\resources"
|
copy /b /y Documents\*.cshtml "C:\ProgramData\Elwig\resources"
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
</Task>
|
</Task>
|
||||||
</UsingTask>
|
</UsingTask>
|
||||||
<Target Name="CustomBeforeBuild" BeforeTargets="BeforeBuild">
|
<Target Name="CustomBeforeBuild" BeforeTargets="BeforeBuild">
|
||||||
<Exec Command="curl -s "http://www.columbia.edu/~em36/PDFtoPrinter.exe" -z "$(TargetDir)PDFtoPrinter.exe" -o "$(TargetDir)PDFtoPrinter.exe"" />
|
<Exec Command="curl -s -L "http://www.columbia.edu/~em36/PDFtoPrinter.exe" -z "$(TargetDir)PDFtoPrinter.exe" -o "$(TargetDir)PDFtoPrinter.exe"" />
|
||||||
<Exec Command="dotnet publish "$(SolutionDir)Elwig\Elwig.csproj" "/p:PublishProfile=$(SolutionDir)\Elwig\Properties\PublishProfiles\FolderProfile.pubxml"" />
|
<Exec Command="dotnet publish "$(SolutionDir)Elwig\Elwig.csproj" "/p:PublishProfile=$(SolutionDir)\Elwig\Properties\PublishProfiles\FolderProfile.pubxml"" />
|
||||||
<GetFileVersion AssemblyPath="..\Elwig\bin\Publish\Elwig.exe">
|
<GetFileVersion AssemblyPath="..\Elwig\bin\Publish\Elwig.exe">
|
||||||
<Output TaskParameter="Version" PropertyName="ElwigFileVersion" />
|
<Output TaskParameter="Version" PropertyName="ElwigFileVersion" />
|
||||||
|
|||||||
+2
-2
@@ -5,8 +5,8 @@
|
|||||||
<Cultures>de-AT</Cultures>
|
<Cultures>de-AT</Cultures>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Target Name="CustomBeforeBuild" BeforeTargets="BeforeBuild">
|
<Target Name="CustomBeforeBuild" BeforeTargets="BeforeBuild">
|
||||||
<Exec Command='curl -L -s "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -z "$(TargetDir)MicrosoftEdgeWebview2Setup.exe" -o "$(TargetDir)MicrosoftEdgeWebview2Setup.exe"' />
|
<Exec Command='curl -s -L "https://go.microsoft.com/fwlink/p/?LinkId=2124703" -z "$(TargetDir)MicrosoftEdgeWebview2Setup.exe" -o "$(TargetDir)MicrosoftEdgeWebview2Setup.exe"' />
|
||||||
<Exec Command='curl -L -s "https://aka.ms/vs/17/release/vc_redist.x86.exe" -z "$(TargetDir)VC_redist.x86.exe" -o "$(TargetDir)VC_redist.x86.exe"' />
|
<Exec Command='curl -s -L "https://aka.ms/vs/17/release/vc_redist.x86.exe" -z "$(TargetDir)VC_redist.x86.exe" -o "$(TargetDir)VC_redist.x86.exe"' />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<DefineConstants>ElwigProjectDir=..\Elwig</DefineConstants>
|
<DefineConstants>ElwigProjectDir=..\Elwig</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
+17
-4
@@ -1,4 +1,6 @@
|
|||||||
using Elwig.Helpers;
|
using Elwig;
|
||||||
|
using Elwig.Helpers;
|
||||||
|
using Elwig.Helpers.Billing;
|
||||||
using Microsoft.Data.Sqlite;
|
using Microsoft.Data.Sqlite;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
@@ -9,11 +11,22 @@ namespace Tests {
|
|||||||
private SqliteConnection? Connection;
|
private SqliteConnection? Connection;
|
||||||
|
|
||||||
[OneTimeSetUp]
|
[OneTimeSetUp]
|
||||||
public async Task SetupDatabase() {
|
public async Task Setup_1_Database() {
|
||||||
AppDbContext.ConnectionStringOverride = $"Data Source=ElwigTestDB; Mode=Memory; Foreign Keys=True; Cache=Shared";
|
AppDbContext.ConnectionStringOverride = $"Data Source=ElwigTestDB; Mode=Memory; Foreign Keys=True; Cache=Shared";
|
||||||
Connection = await AppDbContext.ConnectAsync();
|
Connection = await AppDbContext.ConnectAsync();
|
||||||
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.Create.sql");
|
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.Sql.Create.sql");
|
||||||
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.Insert.sql");
|
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.Sql.Insert.sql");
|
||||||
|
}
|
||||||
|
|
||||||
|
[OneTimeSetUp]
|
||||||
|
public void Setup_2_Client() {
|
||||||
|
using var ctx = new AppDbContext();
|
||||||
|
App.Client = new ClientParameters(ctx);
|
||||||
|
}
|
||||||
|
|
||||||
|
[OneTimeSetUp]
|
||||||
|
public async Task Setup_3_BillingData() {
|
||||||
|
await BillingData.Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
[OneTimeTearDown]
|
[OneTimeTearDown]
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
using Elwig.Helpers;
|
using Elwig.Helpers;
|
||||||
using Elwig.Helpers.Billing;
|
using Elwig.Helpers.Billing;
|
||||||
|
using Elwig.Models.Entities;
|
||||||
|
using System.Text.Json;
|
||||||
|
|
||||||
namespace Tests.Helpers {
|
namespace Tests.HelperTests {
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class BillingDataTest {
|
public class BillingDataTest {
|
||||||
|
|
||||||
private static readonly string[] AttributeVariants = ["GV", "GVD", "GVK", "GVS", "GVZ", "WR", "WRS", "ZW", "ZWS", "ZWZ"];
|
private static readonly JsonSerializerOptions JsonOpts = new() { WriteIndented = true };
|
||||||
|
private static readonly string[] Vaributes = ["GV", "GVD", "GVK", "GVS", "GVZ", "WR", "WRS", "ZW", "ZWS", "ZWZ"];
|
||||||
[OneTimeSetUp]
|
|
||||||
public async Task SetupBilling() {
|
|
||||||
await BillingData.Init();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static (string, string?) GetSortIdAttrId(string bucket) {
|
private static (string, string?) GetSortIdAttrId(string bucket) {
|
||||||
return (bucket[..2], bucket.Length > 2 ? bucket[2..] : null);
|
return (bucket[..2], bucket.Length > 2 ? bucket[2..] : null);
|
||||||
@@ -41,7 +39,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_01_Flatrate() {
|
public void TestRead_01_Flatrate() {
|
||||||
var data = PaymentBillingData.FromJson("""
|
var data = PaymentBillingData.FromJson("""
|
||||||
{
|
{
|
||||||
"mode": "elwig",
|
"mode": "elwig",
|
||||||
@@ -49,7 +47,7 @@ namespace Tests.Helpers {
|
|||||||
"payment": 0.5,
|
"payment": 0.5,
|
||||||
"curves": []
|
"curves": []
|
||||||
}
|
}
|
||||||
""", AttributeVariants);
|
""", Vaributes);
|
||||||
Assert.Multiple(() => {
|
Assert.Multiple(() => {
|
||||||
TestCalcOe(data, "GV", 73, 0.5m);
|
TestCalcOe(data, "GV", 73, 0.5m);
|
||||||
TestCalcOe(data, "WRS", 74, 0.5m);
|
TestCalcOe(data, "WRS", 74, 0.5m);
|
||||||
@@ -57,7 +55,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_02_Simple() {
|
public void TestRead_02_Simple() {
|
||||||
var data = PaymentBillingData.FromJson("""
|
var data = PaymentBillingData.FromJson("""
|
||||||
{
|
{
|
||||||
"mode": "elwig",
|
"mode": "elwig",
|
||||||
@@ -74,7 +72,7 @@ namespace Tests.Helpers {
|
|||||||
"geb": 0.10
|
"geb": 0.10
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
""", AttributeVariants);
|
""", Vaributes);
|
||||||
Assert.Multiple(() => {
|
Assert.Multiple(() => {
|
||||||
TestCalcOe(data, "GV", 70, 0.25m);
|
TestCalcOe(data, "GV", 70, 0.25m);
|
||||||
TestCalcOe(data, "GV", 72, 0.25m);
|
TestCalcOe(data, "GV", 72, 0.25m);
|
||||||
@@ -92,7 +90,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_03_GreaterThanAndLessThan() {
|
public void TestRead_03_GreaterThanAndLessThan() {
|
||||||
var data = PaymentBillingData.FromJson("""
|
var data = PaymentBillingData.FromJson("""
|
||||||
{
|
{
|
||||||
"mode": "elwig",
|
"mode": "elwig",
|
||||||
@@ -111,7 +109,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
""", AttributeVariants);
|
""", Vaributes);
|
||||||
Assert.Multiple(() => {
|
Assert.Multiple(() => {
|
||||||
TestCalcKmw(data, "GV", 13.00, 0.10m);
|
TestCalcKmw(data, "GV", 13.00, 0.10m);
|
||||||
TestCalcKmw(data, "GV", 13.50, 0.10m);
|
TestCalcKmw(data, "GV", 13.50, 0.10m);
|
||||||
@@ -131,7 +129,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_04_VariantsAndAttributes() {
|
public void TestRead_04_VariantsAndAttributes() {
|
||||||
var data = PaymentBillingData.FromJson("""
|
var data = PaymentBillingData.FromJson("""
|
||||||
{
|
{
|
||||||
"mode": "elwig",
|
"mode": "elwig",
|
||||||
@@ -145,7 +143,7 @@ namespace Tests.Helpers {
|
|||||||
},
|
},
|
||||||
"curves": []
|
"curves": []
|
||||||
}
|
}
|
||||||
""", AttributeVariants);
|
""", Vaributes);
|
||||||
Assert.Multiple(() => {
|
Assert.Multiple(() => {
|
||||||
TestCalcOe(data, "WR", 73, 0.10m);
|
TestCalcOe(data, "WR", 73, 0.10m);
|
||||||
TestCalcOe(data, "WRS", 73, 0.15m);
|
TestCalcOe(data, "WRS", 73, 0.15m);
|
||||||
@@ -161,7 +159,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_05_QualityLevel() {
|
public void TestRead_05_QualityLevel() {
|
||||||
var data = PaymentBillingData.FromJson("""
|
var data = PaymentBillingData.FromJson("""
|
||||||
{
|
{
|
||||||
"mode": "elwig",
|
"mode": "elwig",
|
||||||
@@ -176,7 +174,7 @@ namespace Tests.Helpers {
|
|||||||
},
|
},
|
||||||
"curves": []
|
"curves": []
|
||||||
}
|
}
|
||||||
""", AttributeVariants);
|
""", Vaributes);
|
||||||
Assert.Multiple(() => {
|
Assert.Multiple(() => {
|
||||||
TestCalcOe(data, "GV", 75, 0.30m, qualid: "WEI");
|
TestCalcOe(data, "GV", 75, 0.30m, qualid: "WEI");
|
||||||
TestCalcOe(data, "ZW", 76, 0.25m, qualid: "WEI");
|
TestCalcOe(data, "ZW", 76, 0.25m, qualid: "WEI");
|
||||||
@@ -192,7 +190,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_06_ModeOeAndKmw() {
|
public void TestRead_06_ModeOeAndKmw() {
|
||||||
var data = PaymentBillingData.FromJson("""
|
var data = PaymentBillingData.FromJson("""
|
||||||
{
|
{
|
||||||
"mode": "elwig",
|
"mode": "elwig",
|
||||||
@@ -218,7 +216,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
""", AttributeVariants);
|
""", Vaributes);
|
||||||
Assert.Multiple(() => {
|
Assert.Multiple(() => {
|
||||||
TestCalcKmw(data, "GV", 15.0, 2.0m);
|
TestCalcKmw(data, "GV", 15.0, 2.0m);
|
||||||
TestCalcKmw(data, "GV", 15.5, 2.272727m);
|
TestCalcKmw(data, "GV", 15.5, 2.272727m);
|
||||||
@@ -234,7 +232,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_07_MultipleCurves() {
|
public void TestRead_07_MultipleCurves() {
|
||||||
var data = PaymentBillingData.FromJson("""
|
var data = PaymentBillingData.FromJson("""
|
||||||
{
|
{
|
||||||
"mode": "elwig",
|
"mode": "elwig",
|
||||||
@@ -278,7 +276,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
""", AttributeVariants);
|
""", Vaributes);
|
||||||
Assert.Multiple(() => {
|
Assert.Multiple(() => {
|
||||||
TestCalcKmw(data, "GV", 15.0, 0.75m);
|
TestCalcKmw(data, "GV", 15.0, 0.75m);
|
||||||
TestCalcKmw(data, "GVS", 15.0, 0.50m);
|
TestCalcKmw(data, "GVS", 15.0, 0.50m);
|
||||||
@@ -303,7 +301,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void Test_08_WgMaster() {
|
public void TestRead_08_WgMaster() {
|
||||||
var data = PaymentBillingData.FromJson("""
|
var data = PaymentBillingData.FromJson("""
|
||||||
{
|
{
|
||||||
"mode": "wgmaster",
|
"mode": "wgmaster",
|
||||||
@@ -337,7 +335,7 @@ namespace Tests.Helpers {
|
|||||||
}
|
}
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
""", AttributeVariants);
|
""", Vaributes);
|
||||||
Assert.Multiple(() => {
|
Assert.Multiple(() => {
|
||||||
TestCalcOe(data, "GVK", 73, 0.032m);
|
TestCalcOe(data, "GVK", 73, 0.032m);
|
||||||
TestCalcOe(data, "ZWS", 74, 0.033m);
|
TestCalcOe(data, "ZWS", 74, 0.033m);
|
||||||
@@ -345,5 +343,162 @@ namespace Tests.Helpers {
|
|||||||
TestCalcOe(data, "GVK", 115, 0.065m);
|
TestCalcOe(data, "GVK", 115, 0.065m);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static List<Varibute> GetSelection(IEnumerable<string> attVars) {
|
||||||
|
return attVars.Select(s => {
|
||||||
|
var sortid = s[..2];
|
||||||
|
var attrid = s.Length > 2 ? s[2..] : null;
|
||||||
|
return new Varibute(
|
||||||
|
new WineVar(sortid, sortid),
|
||||||
|
attrid == null ? null : new WineAttr(attrid, attrid)
|
||||||
|
);
|
||||||
|
}).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestWrite_01_Empty() {
|
||||||
|
List<GraphEntry> entries = [
|
||||||
|
new GraphEntry(1, 4, BillingData.CurveMode.Oe, new() {
|
||||||
|
[73] = 0.5m
|
||||||
|
}, null)
|
||||||
|
];
|
||||||
|
var updated = BillingData.FromGraphEntries(entries);
|
||||||
|
Assert.That(updated.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||||
|
{
|
||||||
|
"mode": "elwig",
|
||||||
|
"version": 1,
|
||||||
|
"payment": 0,
|
||||||
|
"curves": []
|
||||||
|
}
|
||||||
|
"""));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestWrite_02_Flatrate() {
|
||||||
|
List<GraphEntry> entries = [
|
||||||
|
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||||
|
[73] = 0.5m
|
||||||
|
}, null), GetSelection(["GV"]))
|
||||||
|
];
|
||||||
|
var data = BillingData.FromGraphEntries(entries);
|
||||||
|
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||||
|
{
|
||||||
|
"mode": "elwig",
|
||||||
|
"version": 1,
|
||||||
|
"payment": 0.5,
|
||||||
|
"curves": []
|
||||||
|
}
|
||||||
|
"""));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestWrite_03_SingleCurve() {
|
||||||
|
List<GraphEntry> entries = [
|
||||||
|
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||||
|
[73] = 0.5m,
|
||||||
|
[83] = 1.0m
|
||||||
|
}, null), GetSelection(["GV"]))
|
||||||
|
];
|
||||||
|
var data = BillingData.FromGraphEntries(entries);
|
||||||
|
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||||
|
{
|
||||||
|
"mode": "elwig",
|
||||||
|
"version": 1,
|
||||||
|
"payment": "curve:1",
|
||||||
|
"curves": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"mode": "oe",
|
||||||
|
"data": {
|
||||||
|
"73oe": 0.5,
|
||||||
|
"83oe": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
"""));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestWrite_04_Simple() {
|
||||||
|
List<GraphEntry> entries = [
|
||||||
|
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||||
|
[73] = 0.5m,
|
||||||
|
[84] = 1.0m
|
||||||
|
}, null), GetSelection(["GV", "ZW"])),
|
||||||
|
new GraphEntry(10, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||||
|
[73] = 0.75m,
|
||||||
|
}, null), GetSelection(["WR"]))
|
||||||
|
];
|
||||||
|
var data = BillingData.FromGraphEntries(entries);
|
||||||
|
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||||
|
{
|
||||||
|
"mode": "elwig",
|
||||||
|
"version": 1,
|
||||||
|
"payment": {
|
||||||
|
"WR/": 0.75,
|
||||||
|
"default": "curve:1"
|
||||||
|
},
|
||||||
|
"curves": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"mode": "oe",
|
||||||
|
"data": {
|
||||||
|
"73oe": 0.5,
|
||||||
|
"84oe": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
"""));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestWrite_05_Attribute() {
|
||||||
|
List<GraphEntry> entries = [
|
||||||
|
new GraphEntry(0, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||||
|
[73] = 0.5m,
|
||||||
|
[84] = 1.0m
|
||||||
|
}, null), GetSelection(["GVB", "ZWB"])),
|
||||||
|
new GraphEntry(2, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||||
|
[73] = 0.75m,
|
||||||
|
}, null), GetSelection(["WR", "BL", "RR", "FV"])),
|
||||||
|
new GraphEntry(4, 4, new BillingData.Curve(BillingData.CurveMode.Oe, new() {
|
||||||
|
[73] = 0.65m,
|
||||||
|
[84] = 1.2m
|
||||||
|
}, null), GetSelection(["BP", "SA"]))
|
||||||
|
];
|
||||||
|
var data = BillingData.FromGraphEntries(entries);
|
||||||
|
Assert.That(data.ToJsonString(JsonOpts), Is.EqualTo("""
|
||||||
|
{
|
||||||
|
"mode": "elwig",
|
||||||
|
"version": 1,
|
||||||
|
"payment": {
|
||||||
|
"BP/": "curve:2",
|
||||||
|
"SA/": "curve:2",
|
||||||
|
"default": 0.75,
|
||||||
|
"/B": "curve:1"
|
||||||
|
},
|
||||||
|
"curves": [
|
||||||
|
{
|
||||||
|
"id": 1,
|
||||||
|
"mode": "oe",
|
||||||
|
"data": {
|
||||||
|
"73oe": 0.5,
|
||||||
|
"84oe": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 2,
|
||||||
|
"mode": "oe",
|
||||||
|
"data": {
|
||||||
|
"73oe": 0.65,
|
||||||
|
"84oe": 1.2
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
"""));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,349 @@
|
|||||||
|
using Elwig.Helpers;
|
||||||
|
using Elwig.Helpers.Billing;
|
||||||
|
using Microsoft.Data.Sqlite;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
namespace Tests.HelperTests {
|
||||||
|
[TestFixture]
|
||||||
|
public class BillingTest {
|
||||||
|
|
||||||
|
private const int Year1 = 2020, Year2 = 2021;
|
||||||
|
private const int MgNr1 = 101, MgNr2 = 102, MgNr3 = 103, MgNr4 = 104;
|
||||||
|
|
||||||
|
private const decimal
|
||||||
|
GV_ungeb = 0.50m,
|
||||||
|
GV_geb = 0.60m,
|
||||||
|
GVB_ungeb = 0.54m,
|
||||||
|
GVB_geb = 0.64m,
|
||||||
|
GVK_ungeb = 0.61m,
|
||||||
|
GVK_geb = 0.71m,
|
||||||
|
WEI = 0.10m;
|
||||||
|
|
||||||
|
private SqliteConnection? Connection;
|
||||||
|
|
||||||
|
[OneTimeSetUp]
|
||||||
|
public async Task SetupDatabase() {
|
||||||
|
Connection = await AppDbContext.ConnectAsync();
|
||||||
|
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.Sql.BillingInsert.sql");
|
||||||
|
}
|
||||||
|
|
||||||
|
[OneTimeTearDown]
|
||||||
|
public async Task TeardownDatabase() {
|
||||||
|
if (Connection == null) return;
|
||||||
|
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.Sql.BillingDelete.sql");
|
||||||
|
await Connection.DisposeAsync();
|
||||||
|
Connection = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
[SetUp]
|
||||||
|
public async Task CreatePaymentVariant() {
|
||||||
|
var json = """
|
||||||
|
{
|
||||||
|
"mode": "elwig",
|
||||||
|
"version": 1,
|
||||||
|
"payment": {
|
||||||
|
"GV/": "curve:0",
|
||||||
|
"GV/B": "curve:1",
|
||||||
|
"GV/K": "curve:2"
|
||||||
|
},
|
||||||
|
"quality": {"WEI": 0.1},
|
||||||
|
"curves": [{
|
||||||
|
"id": 0,
|
||||||
|
"mode": "oe",
|
||||||
|
"data": {"15kmw": 0.5},
|
||||||
|
"geb": 0.1
|
||||||
|
}, {
|
||||||
|
"id": 1,
|
||||||
|
"mode": "oe",
|
||||||
|
"data": {"15kmw": 0.54},
|
||||||
|
"geb": 0.1
|
||||||
|
}, {
|
||||||
|
"id": 2,
|
||||||
|
"mode": "oe",
|
||||||
|
"data": {"15kmw": 0.61},
|
||||||
|
"geb": 0.1
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
""";
|
||||||
|
await InsertPaymentVariant(Year1, 1, json);
|
||||||
|
await InsertPaymentVariant(Year2, 1, json);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TearDown]
|
||||||
|
public async Task CleanupDatabasePayment() {
|
||||||
|
if (Connection == null) return;
|
||||||
|
await AppDbContext.ExecuteBatch(Connection, """
|
||||||
|
DELETE FROM credit;
|
||||||
|
DELETE FROM payment_variant;
|
||||||
|
DELETE FROM delivery_part_bucket;
|
||||||
|
""");
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task<Dictionary<string, AreaComBucket>> GetMemberAreaCommitmentBuckets(int year, int mgnr) {
|
||||||
|
var ctx = new AppDbContext();
|
||||||
|
return ctx.GetMemberAreaCommitmentBuckets(year, mgnr, Connection);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task<Dictionary<string, int>> GetMemberDeliveryBuckets(int year, int mgnr) {
|
||||||
|
var ctx = new AppDbContext();
|
||||||
|
return ctx.GetMemberDeliveryBuckets(year, mgnr, Connection);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task<Dictionary<string, int>> GetMemberPaymentBuckets(int year, int mgnr) {
|
||||||
|
var ctx = new AppDbContext();
|
||||||
|
return ctx.GetMemberPaymentBuckets(year, mgnr, Connection);
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task<Dictionary<(string, string), (int, decimal)>> GetMemberDeliveryPrices(int year, int mgnr) {
|
||||||
|
var buckets = new Dictionary<(string, string), (int, decimal)>();
|
||||||
|
using (var cmd = Connection!.CreateCommand()) {
|
||||||
|
cmd.CommandText = $"""
|
||||||
|
SELECT lsnr || '/' || d.dpnr, d.sortid || b.discr, b.value, p.price
|
||||||
|
FROM v_delivery d
|
||||||
|
LEFT JOIN payment_delivery_part_bucket p ON (p.year, p.did, p.dpnr) = (d.year, d.did, d.dpnr)
|
||||||
|
LEFT JOIN delivery_part_bucket b ON (b.year, b.did, b.dpnr, b.bktnr) = (p.year, p.did, p.dpnr, p.bktnr)
|
||||||
|
WHERE d.year = {year} AND mgnr = {mgnr}
|
||||||
|
""";
|
||||||
|
using var reader = await cmd.ExecuteReaderAsync();
|
||||||
|
while (await reader.ReadAsync()) {
|
||||||
|
var lsnr = reader.GetString(0);
|
||||||
|
var bucket = reader.GetString(1);
|
||||||
|
buckets[(lsnr, bucket)] = (reader.GetInt32(2), Utils.DecFromDb(reader.GetInt32(3), 4));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return buckets;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Task InsertPaymentVariant(int year, int avnr, string data) {
|
||||||
|
return AppDbContext.ExecuteBatch(Connection!, $"""
|
||||||
|
INSERT INTO payment_variant (year, avnr, name, date, transfer_date, test_variant, calc_time, data)
|
||||||
|
VALUES ({year}, {avnr}, 'Test', '2021-01-15', NULL, TRUE, NULL, '{data}');
|
||||||
|
""");
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_01_NoActiveAreaComs() {
|
||||||
|
int mgnr = MgNr1, year = Year1;
|
||||||
|
|
||||||
|
var areaCom = await GetMemberAreaCommitmentBuckets(year, mgnr);
|
||||||
|
Assert.That(areaCom, Is.Empty);
|
||||||
|
var delivery = await GetMemberDeliveryBuckets(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(delivery, Has.Count.EqualTo(4));
|
||||||
|
Assert.That(delivery["GV"], Is.EqualTo(16_000));
|
||||||
|
Assert.That(delivery["GV_"], Is.EqualTo( 1_000));
|
||||||
|
Assert.That(delivery["GVB"], Is.EqualTo( 8_000));
|
||||||
|
Assert.That(delivery["GVK"], Is.EqualTo( 4_000));
|
||||||
|
});
|
||||||
|
|
||||||
|
BillingVariant b = new(year, 1);
|
||||||
|
await b.CalculateBuckets(false, false, false);
|
||||||
|
var payment = await GetMemberPaymentBuckets(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(payment, Has.Count.EqualTo(1));
|
||||||
|
Assert.That(payment["GV_"], Is.EqualTo(17_000));
|
||||||
|
});
|
||||||
|
|
||||||
|
await b.Calculate();
|
||||||
|
var prices = await GetMemberDeliveryPrices(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(prices, Has.Count.EqualTo(6));
|
||||||
|
// Kabinett
|
||||||
|
Assert.That(prices[("20201001X001/1", "GV_")], Is.EqualTo((4_000, GV_ungeb)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20201001X001/2", "GV_")], Is.EqualTo((4_000, GV_ungeb)));
|
||||||
|
// Bio
|
||||||
|
Assert.That(prices[("20201001X002/1", "GV_")], Is.EqualTo((4_000, GVB_ungeb)));
|
||||||
|
// Bio
|
||||||
|
Assert.That(prices[("20201001X002/2", "GV_")], Is.EqualTo((4_000, GVB_ungeb)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20201001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20201001X003/2", "GV_")], Is.EqualTo(( 500, GV_ungeb)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_02_SimpleNotStrictAreaComs() {
|
||||||
|
int mgnr = MgNr1, year = Year2;
|
||||||
|
|
||||||
|
var areaCom = await GetMemberAreaCommitmentBuckets(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(areaCom, Has.Count.EqualTo(1));
|
||||||
|
Assert.That(areaCom["GV"], Is.EqualTo(new AreaComBucket(10_000, 5_000, 10_000)));
|
||||||
|
});
|
||||||
|
var delivery = await GetMemberDeliveryBuckets(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(delivery, Has.Count.EqualTo(4));
|
||||||
|
Assert.That(delivery["GV"], Is.EqualTo(16_000));
|
||||||
|
Assert.That(delivery["GV_"], Is.EqualTo( 1_000));
|
||||||
|
Assert.That(delivery["GVB"], Is.EqualTo( 8_000));
|
||||||
|
Assert.That(delivery["GVK"], Is.EqualTo( 4_000));
|
||||||
|
});
|
||||||
|
|
||||||
|
BillingVariant b = new(year, 1);
|
||||||
|
await b.CalculateBuckets(false, false, false, Connection);
|
||||||
|
var payment = await GetMemberPaymentBuckets(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(payment, Has.Count.EqualTo(2));
|
||||||
|
Assert.That(payment["GV_"], Is.EqualTo( 7_000));
|
||||||
|
Assert.That(payment["GV"], Is.EqualTo(10_000));
|
||||||
|
});
|
||||||
|
|
||||||
|
await b.Calculate(false, false, false);
|
||||||
|
var prices = await GetMemberDeliveryPrices(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(prices, Has.Count.EqualTo(10));
|
||||||
|
// Kabinett
|
||||||
|
Assert.That(prices[("20211001X001/1", "GV_")], Is.EqualTo((2_000, GV_ungeb)));
|
||||||
|
Assert.That(prices[("20211001X001/1", "GV")] , Is.EqualTo((2_000, GV_geb)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20211001X001/2", "GV_")], Is.EqualTo((4_000, GV_ungeb)));
|
||||||
|
Assert.That(prices[("20211001X001/2", "GV")], Is.EqualTo(( 0, GV_geb)));
|
||||||
|
// Bio
|
||||||
|
Assert.That(prices[("20211001X002/1", "GV_")], Is.EqualTo(( 0, GVB_ungeb)));
|
||||||
|
Assert.That(prices[("20211001X002/1", "GV")], Is.EqualTo((4_000, GVB_geb)));
|
||||||
|
// Bio
|
||||||
|
Assert.That(prices[("20211001X002/2", "GV_")], Is.EqualTo(( 0, GVB_ungeb)));
|
||||||
|
Assert.That(prices[("20211001X002/2", "GV")], Is.EqualTo((4_000, GVB_geb)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20211001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20211001X003/2", "GV_")], Is.EqualTo(( 500, GV_ungeb)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_03_SimpleNotStrictAreaComs_HonorGebunden() {
|
||||||
|
int mgnr = MgNr1, year = Year2;
|
||||||
|
|
||||||
|
var areaCom = await GetMemberAreaCommitmentBuckets(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(areaCom, Has.Count.EqualTo(1));
|
||||||
|
Assert.That(areaCom["GV"], Is.EqualTo(new AreaComBucket(10_000, 5_000, 10_000)));
|
||||||
|
});
|
||||||
|
var delivery = await GetMemberDeliveryBuckets(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(delivery, Has.Count.EqualTo(4));
|
||||||
|
Assert.That(delivery["GV"], Is.EqualTo(16_000));
|
||||||
|
Assert.That(delivery["GV_"], Is.EqualTo( 1_000));
|
||||||
|
Assert.That(delivery["GVB"], Is.EqualTo( 8_000));
|
||||||
|
Assert.That(delivery["GVK"], Is.EqualTo( 4_000));
|
||||||
|
});
|
||||||
|
|
||||||
|
BillingVariant b = new(year, 1);
|
||||||
|
await b.CalculateBuckets(true, false, false, Connection);
|
||||||
|
var payment = await GetMemberPaymentBuckets(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(payment, Has.Count.EqualTo(2));
|
||||||
|
Assert.That(payment["GV_"], Is.EqualTo(9_000));
|
||||||
|
Assert.That(payment["GV"], Is.EqualTo(8_000));
|
||||||
|
});
|
||||||
|
|
||||||
|
await b.Calculate(true, false, false);
|
||||||
|
var prices = await GetMemberDeliveryPrices(year, mgnr);
|
||||||
|
Assert.Multiple(() => {
|
||||||
|
Assert.That(prices, Has.Count.EqualTo(8));
|
||||||
|
// Kabinett
|
||||||
|
Assert.That(prices[("20211001X001/1", "GV_")], Is.EqualTo(( 0, GV_ungeb)));
|
||||||
|
Assert.That(prices[("20211001X001/1", "GV")], Is.EqualTo((4_000, GV_geb)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20211001X001/2", "GV_")], Is.EqualTo((4_000, GV_ungeb)));
|
||||||
|
// Bio
|
||||||
|
Assert.That(prices[("20211001X002/1", "GV_")], Is.EqualTo(( 0, GVB_ungeb)));
|
||||||
|
Assert.That(prices[("20211001X002/1", "GV")], Is.EqualTo((4_000, GVB_geb)));
|
||||||
|
// Bio
|
||||||
|
Assert.That(prices[("20211001X002/2", "GV_")], Is.EqualTo((4_000, GVB_ungeb)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20211001X003/1", "GV_")], Is.EqualTo(( 500, WEI)));
|
||||||
|
// ohne Attribut
|
||||||
|
Assert.That(prices[("20211001X003/2", "GV_")], Is.EqualTo(( 500, GV_ungeb)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_04_ComplexNotStrictAreaComs() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_05_ComplexNotStrictAreaComs_HonorGebunden() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_06_StrictAreaComs_NoFillLower_NotAllowed() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_07_StrictAreaComs_NoFillLower_Allowed() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_08_StrictAreaComs_NoFillLower_Allowed_AvoidUnderDeliveries() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_09_StrictAreaComs_FillLowerUntilObligation_NotAllowed() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_10_StrictAreaComs_FillLowerUntilObligation_Allowed() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_11_StrictAreaComs_FillLowerUntilObligation_Allowed_AvoidUnderDeliveries() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_12_StrictAreaComs_FillLowerUntilObligation_NotAllowed() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_13_StrictAreaComs_FillLowerUntilObligation_Allowed() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_14_StrictAreaComs_FillLowerUntilObligation_Allowed_AvoidUnderDeliveries() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_15_StrictAreaComs_FillLowerUntilRight_NotAllowed() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_16_StrictAreaComs_FillLowerUntilRight_Allowed() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Not implemented yet")]
|
||||||
|
public async Task Test_17_StrictAreaComs_FillLowerUntilRight_Allowed_AvoidUnderDeliveries() {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,113 @@
|
|||||||
|
using Elwig.Helpers;
|
||||||
|
using Elwig.Helpers.Export;
|
||||||
|
using Elwig.Models.Dtos;
|
||||||
|
using Elwig.Models.Entities;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
|
namespace Tests.HelperTests {
|
||||||
|
// see https://www.iso20022.org/iso-20022-message-definitions
|
||||||
|
// and https://www.iso20022.org/catalogue-messages/iso-20022-messages-archive?search=pain
|
||||||
|
[TestFixture]
|
||||||
|
public class EbicsTest {
|
||||||
|
|
||||||
|
public static readonly string FileName = Path.Combine(Path.GetTempPath(), "test_ebics.xml");
|
||||||
|
public static readonly string Iban = "AT123456789012345678";
|
||||||
|
|
||||||
|
private static void ValidateSchema(string xmlPath, int version) {
|
||||||
|
XmlDocument xml = new();
|
||||||
|
xml.Load(xmlPath);
|
||||||
|
var schema = new XmlTextReader(Assembly.GetExecutingAssembly()
|
||||||
|
.GetManifestResourceStream($"Tests.Resources.Schemas.pain.001.001.{version:00}.xsd")!);
|
||||||
|
xml.Schemas.Add(null, schema);
|
||||||
|
xml.Validate(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static async Task CreateXmlFile(int version) {
|
||||||
|
var v = new PaymentVar() {
|
||||||
|
Year = 2020,
|
||||||
|
AvNr = 1,
|
||||||
|
Name = "Endauszahlung",
|
||||||
|
TransferDate = new DateOnly(2021, 6, 15),
|
||||||
|
};
|
||||||
|
using var ctx = new AppDbContext();
|
||||||
|
var members = ctx.Members.ToList();
|
||||||
|
Assert.That(members, Has.Count.GreaterThan(0));
|
||||||
|
using var exporter = new Ebics(v, FileName, version);
|
||||||
|
await exporter.ExportAsync(members.Select(m => new Transaction(m, 1234.56m, "EUR", m.MgNr % 100)));
|
||||||
|
}
|
||||||
|
|
||||||
|
[TearDown]
|
||||||
|
public static void RemoveXmlFile() {
|
||||||
|
File.Delete(FileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Version has no need to be supported")]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV01() {
|
||||||
|
await CreateXmlFile(1);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
[Ignore("Version has no need to be supported")]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV02() {
|
||||||
|
await CreateXmlFile(2);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV03() {
|
||||||
|
await CreateXmlFile(3);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 3));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV04() {
|
||||||
|
await CreateXmlFile(4);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV05() {
|
||||||
|
await CreateXmlFile(5);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 5));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV06() {
|
||||||
|
await CreateXmlFile(6);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 6));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV07() {
|
||||||
|
await CreateXmlFile(7);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 7));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV08() {
|
||||||
|
await CreateXmlFile(8);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 8));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV09() {
|
||||||
|
await CreateXmlFile(9);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 9));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV10() {
|
||||||
|
await CreateXmlFile(10);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 10));
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public async Task Test_CustomerCreditTransferInitiationV11() {
|
||||||
|
await CreateXmlFile(11);
|
||||||
|
Assert.DoesNotThrow(() => ValidateSchema(FileName, 11));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
using Elwig.Helpers;
|
using Elwig.Helpers;
|
||||||
|
|
||||||
namespace Tests.Helpers {
|
namespace Tests.HelperTests {
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class UtilsTest {
|
public class UtilsTest {
|
||||||
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
using Elwig.Helpers;
|
using Elwig.Helpers;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
|
||||||
namespace Tests.Helpers {
|
namespace Tests.HelperTests {
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
[Apartment(ApartmentState.STA)]
|
[Apartment(ApartmentState.STA)]
|
||||||
public class ValidatorTest {
|
public class ValidatorTest {
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
using Elwig.Helpers;
|
|
||||||
using Microsoft.Data.Sqlite;
|
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace Tests.Helpers {
|
|
||||||
[TestFixture]
|
|
||||||
public class BillingTest {
|
|
||||||
|
|
||||||
private SqliteConnection? Connection;
|
|
||||||
|
|
||||||
[OneTimeSetUp]
|
|
||||||
public async Task SetupDatabase() {
|
|
||||||
Connection = await AppDbContext.ConnectAsync();
|
|
||||||
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.BillingInsert.sql");
|
|
||||||
}
|
|
||||||
|
|
||||||
[OneTimeTearDown]
|
|
||||||
public async Task TeardownDatabase() {
|
|
||||||
if (Connection == null) return;
|
|
||||||
await AppDbContext.ExecuteEmbeddedScript(Connection, Assembly.GetExecutingAssembly(), "Tests.Resources.BillingDelete.sql");
|
|
||||||
await Connection.DisposeAsync();
|
|
||||||
Connection = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void Test() {
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
-- deletes for HelpersBillingTest
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
-- inserts for HelpersBillingTest
|
|
||||||
@@ -0,0 +1,747 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--Generated by SWIFTStandards Workstation (build:R5.1.0.4) on 2005 Sep 13 16:04:25-->
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:iso:std:iso:20022:xsd:pain.001.001.01" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:xsd:pain.001.001.01">
|
||||||
|
<xs:element name="Document" type="Document"/>
|
||||||
|
<xs:complexType name="AccountIdentification1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="IBAN" type="IBANIdentifier"/>
|
||||||
|
<xs:element name="BBAN" type="BBANIdentifier"/>
|
||||||
|
<xs:element name="UPIC" type="UPICIdentifier"/>
|
||||||
|
<xs:element name="DmstAcct" type="SimpleIdentificationInformation"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="AddressType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="ADDR"/>
|
||||||
|
<xs:enumeration value="PBOX"/>
|
||||||
|
<xs:enumeration value="HOME"/>
|
||||||
|
<xs:enumeration value="BIZZ"/>
|
||||||
|
<xs:enumeration value="MLTO"/>
|
||||||
|
<xs:enumeration value="DLVY"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="AmountType1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="InstdAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="EqvtAmt" type="EquivalentAmount"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="AustrianBankleitzahlIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="AT[0-9]{5,5}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BBANIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[a-zA-Z0-9]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BEIIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BatchBookingIndicator">
|
||||||
|
<xs:restriction base="xs:boolean"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="BranchAndFinancialInstitutionIdentification">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification1"/>
|
||||||
|
<xs:element name="BrnchId" type="BranchData" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="BranchData">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Nm" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CHIPSParticipantIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="CP[0-9]{4,4}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="CHIPSUniversalIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="CH[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="CanadianPaymentsARNIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="CA[0-9]{9,9}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CashAccount3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="AccountIdentification1Choice"/>
|
||||||
|
<xs:element name="Tp" type="CashAccountType3Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Ccy" type="CurrencyCode" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CashAccountType3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CASH"/>
|
||||||
|
<xs:enumeration value="CHAR"/>
|
||||||
|
<xs:enumeration value="SACC"/>
|
||||||
|
<xs:enumeration value="CACC"/>
|
||||||
|
<xs:enumeration value="SVGS"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="CashClearingSystem2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="RTG"/>
|
||||||
|
<xs:enumeration value="ACH"/>
|
||||||
|
<xs:enumeration value="CHI"/>
|
||||||
|
<xs:enumeration value="FDN"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ChargeBearer1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="OUR"/>
|
||||||
|
<xs:enumeration value="BEN"/>
|
||||||
|
<xs:enumeration value="SHA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Cheque2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="ChqTp" type="ChequeType2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChqNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChqFr" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DlvryMtd" type="ChequeDelivery1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DlvrTo" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="InstrPrty" type="Priority2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChqMtrtyDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="FrmsCd" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="MemoFld" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RgnlClrZone" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeDelivery1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MLDB"/>
|
||||||
|
<xs:enumeration value="MLCD"/>
|
||||||
|
<xs:enumeration value="MLFA"/>
|
||||||
|
<xs:enumeration value="CRDB"/>
|
||||||
|
<xs:enumeration value="CRCD"/>
|
||||||
|
<xs:enumeration value="CRFA"/>
|
||||||
|
<xs:enumeration value="PUDB"/>
|
||||||
|
<xs:enumeration value="PUCD"/>
|
||||||
|
<xs:enumeration value="PUFA"/>
|
||||||
|
<xs:enumeration value="RGDB"/>
|
||||||
|
<xs:enumeration value="RGCD"/>
|
||||||
|
<xs:enumeration value="RGFA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ChequeType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CCHQ"/>
|
||||||
|
<xs:enumeration value="CCCH"/>
|
||||||
|
<xs:enumeration value="BCHQ"/>
|
||||||
|
<xs:enumeration value="DRFT"/>
|
||||||
|
<xs:enumeration value="ELDR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ClearingSystemMemberIdentificationChoice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="USCHU" type="CHIPSUniversalIdentifier"/>
|
||||||
|
<xs:element name="NZNCC" type="NewZealandNCCIdentifier"/>
|
||||||
|
<xs:element name="IENSC" type="IrishNSCIdentifier"/>
|
||||||
|
<xs:element name="GBSC" type="UKDomesticSortCodeIdentifier"/>
|
||||||
|
<xs:element name="USCH" type="CHIPSParticipantIdentifier"/>
|
||||||
|
<xs:element name="CHBC" type="SwissBCIdentifier"/>
|
||||||
|
<xs:element name="USFW" type="FedwireRoutingNumberIdentifier"/>
|
||||||
|
<xs:element name="PTNCC" type="PortugueseNCCIdentifier"/>
|
||||||
|
<xs:element name="RUCB" type="RussianCentralBankIdentificationCodeIdentifier"/>
|
||||||
|
<xs:element name="ITNCC" type="ItalianDomesticIdentifier"/>
|
||||||
|
<xs:element name="ATBLZ" type="AustrianBankleitzahlIdentifier"/>
|
||||||
|
<xs:element name="CACPA" type="CanadianPaymentsARNIdentifier"/>
|
||||||
|
<xs:element name="CHSIC" type="SwissSICIdentifier"/>
|
||||||
|
<xs:element name="DEBLZ" type="GermanBankleitzahlIdentifier"/>
|
||||||
|
<xs:element name="ESNCC" type="SpanishDomesticInterbankingIdentifier"/>
|
||||||
|
<xs:element name="ZANCC" type="SouthAfricanNCCIdentifier"/>
|
||||||
|
<xs:element name="HKNCC" type="HongKongBankIdentifier"/>
|
||||||
|
<xs:element name="AUBSBx" type="ExtensiveBranchNetworkIdentifier"/>
|
||||||
|
<xs:element name="AUBSBs" type="SmallNetworkIdentifier"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CountryCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="CreditTransferType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CORT"/>
|
||||||
|
<xs:enumeration value="SALA"/>
|
||||||
|
<xs:enumeration value="TREA"/>
|
||||||
|
<xs:enumeration value="CASH"/>
|
||||||
|
<xs:enumeration value="DIVI"/>
|
||||||
|
<xs:enumeration value="GOVT"/>
|
||||||
|
<xs:enumeration value="INTE"/>
|
||||||
|
<xs:enumeration value="LOAN"/>
|
||||||
|
<xs:enumeration value="PENS"/>
|
||||||
|
<xs:enumeration value="SECU"/>
|
||||||
|
<xs:enumeration value="SSBE"/>
|
||||||
|
<xs:enumeration value="SUPP"/>
|
||||||
|
<xs:enumeration value="TAXS"/>
|
||||||
|
<xs:enumeration value="TRAD"/>
|
||||||
|
<xs:enumeration value="VATX"/>
|
||||||
|
<xs:enumeration value="HEDG"/>
|
||||||
|
<xs:enumeration value="INTC"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CreditTransferTypeIdentification">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="CreditTransferType2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="LclInstrm" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:choice>
|
||||||
|
<xs:element name="InstrPrty" type="Priority2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="SttlmPrty" type="SettlementPriorityChoice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CurrencyAndAmount_SimpleType">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:minInclusive value="0"/>
|
||||||
|
<xs:fractionDigits value="5"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CurrencyAndAmount">
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="CurrencyAndAmount_SimpleType">
|
||||||
|
<xs:attribute name="Ccy" type="CurrencyCode" use="required"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CurrencyCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{3,3}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="DecimalNumber">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="17"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Document">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="pain.001.001.01" type="pain.001.001.01"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DocumentType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MSIN"/>
|
||||||
|
<xs:enumeration value="CNFA"/>
|
||||||
|
<xs:enumeration value="DNFA"/>
|
||||||
|
<xs:enumeration value="CINV"/>
|
||||||
|
<xs:enumeration value="CREN"/>
|
||||||
|
<xs:enumeration value="DEBN"/>
|
||||||
|
<xs:enumeration value="HIRI"/>
|
||||||
|
<xs:enumeration value="SBIN"/>
|
||||||
|
<xs:enumeration value="RADM"/>
|
||||||
|
<xs:enumeration value="RPIN"/>
|
||||||
|
<xs:enumeration value="CMCN"/>
|
||||||
|
<xs:enumeration value="FXDR"/>
|
||||||
|
<xs:enumeration value="SOAC"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="DunsIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{9,9}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="EANGLNIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{13,13}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="EquivalentAmount">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="CcyOfTrf" type="CurrencyCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ExtensiveBranchNetworkIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="AU[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="FedwireRoutingNumberIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="FW[0-9]{9,9}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="FinancialInstitutionIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BIC" type="BICIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ClrSysMmbId" type="ClearingSystemMemberIdentificationChoice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PrtryId" type="GenericIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericIdentification3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericIdentification4">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element name="IdTp" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericPaymentTransaction3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtId" type="PaymentIdentification"/>
|
||||||
|
<xs:element name="Purp" type="PurposeChoice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Amt" type="AmountType1Choice"/>
|
||||||
|
<xs:element name="ChqInstr" type="Cheque2" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="OrgtgPty" type="PartyIdentification1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Cdtr" type="PartyIdentification1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrAcct" type="CashAccount3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrCtryOfRes" type="CountryCode" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="FnlAgt" type="BranchAndFinancialInstitutionIdentification" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="FnlAgtAcct" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="FnlPty" type="PartyIdentification1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChrgBr" type="ChargeBearer1Code"/>
|
||||||
|
<xs:element name="XchgCtrctRef" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RgltryRptg" type="StructuredRegulatoryReporting2" minOccurs="0" maxOccurs="3"/>
|
||||||
|
<xs:element name="InstrForFnlAgt" type="InstructionForFinalAgent" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="InstrForFrstAgt" type="InstructionForFirstAgent" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RmtInf" type="RemittanceInformation3Choice" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="GermanBankleitzahlIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="BL[0-9]{8,8}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="GroupInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="GrpId" type="Max35Text"/>
|
||||||
|
<xs:element name="CreDtTm" type="ISODateTime"/>
|
||||||
|
<xs:element name="Authstn" type="Max128Text" minOccurs="0" maxOccurs="2"/>
|
||||||
|
<xs:element name="CtrlSum" type="DecimalNumber" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="BtchBookg" type="BatchBookingIndicator" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="NbOfTxs" type="Max15NumericText" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Grpg" type="GroupingIndicator" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="InitgPty" type="PartyIdentification1"/>
|
||||||
|
<xs:element name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="GroupingIndicator">
|
||||||
|
<xs:restriction base="xs:boolean"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="HongKongBankIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="HK[0-9]{3,3}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="IBANIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[a-zA-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODate">
|
||||||
|
<xs:restriction base="xs:date"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODateTime">
|
||||||
|
<xs:restriction base="xs:dateTime"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Instruction3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHQB"/>
|
||||||
|
<xs:enumeration value="HOLD"/>
|
||||||
|
<xs:enumeration value="PHOB"/>
|
||||||
|
<xs:enumeration value="TELB"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="InstructionForFinalAgent">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Cd" type="Instruction3Code" minOccurs="0" maxOccurs="2"/>
|
||||||
|
<xs:element name="Prtry" type="Max140Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="InstructionForFirstAgent">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="RmtLctnMtd" type="RemittanceLocationMethod1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RmtLctnElctrncAdr" type="Max128Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RmtLctnPstlAdr" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DbtPurp" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Prtry" type="Max140Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Tax" type="TaxInformation1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="IrishNSCIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="IE[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ItalianDomesticIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="IT[0-9]{10,10}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max128Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="128"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max140Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="140"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max15NumericText">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{1,15}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max16Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="16"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max35Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max3Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="3"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max70Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="70"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="NameAndAddress3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max70Text"/>
|
||||||
|
<xs:element name="Adr" type="PostalAddress1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="NewZealandNCCIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="NZ[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="NonFinancialInstitutionIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BEI" type="BEIIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="EANGLN" type="EANGLNIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="USCHU" type="CHIPSUniversalIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DUNS" type="DunsIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="BkPtyId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxIdNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PrtryId" type="GenericIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Party1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="OrgId" type="NonFinancialInstitutionIdentification1"/>
|
||||||
|
<xs:element name="PrvtId" type="PersonIdentification2" minOccurs="1" maxOccurs="2"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PartyIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Id" type="Party1Choice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentIdentification">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="InstrId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="EndToEndId" type="Max35Text"/>
|
||||||
|
<xs:element name="PmtRmtId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentInformation6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="ReqdExctnDt" type="ISODate"/>
|
||||||
|
<xs:element name="PmtMtdByFrstAgt" type="PaymentMethod1Code"/>
|
||||||
|
<xs:element name="CdtTrfTpId" type="CreditTransferTypeIdentification" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Dbtr" type="PartyIdentification1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DbtrCtryOfRes" type="CountryCode" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DbtrAcct" type="CashAccount3"/>
|
||||||
|
<xs:element name="FrstAgt" type="BranchAndFinancialInstitutionIdentification"/>
|
||||||
|
<xs:element name="ChrgsAcct" type="CashAccount3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PmtTx" type="GenericPaymentTransaction3" minOccurs="1" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PaymentMethod1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHK"/>
|
||||||
|
<xs:enumeration value="TRF"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="PaymentPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="SALA"/>
|
||||||
|
<xs:enumeration value="TREA"/>
|
||||||
|
<xs:enumeration value="ADVA"/>
|
||||||
|
<xs:enumeration value="AGRT"/>
|
||||||
|
<xs:enumeration value="ALMY"/>
|
||||||
|
<xs:enumeration value="BECH"/>
|
||||||
|
<xs:enumeration value="BENE"/>
|
||||||
|
<xs:enumeration value="BONU"/>
|
||||||
|
<xs:enumeration value="CASH"/>
|
||||||
|
<xs:enumeration value="CBFF"/>
|
||||||
|
<xs:enumeration value="CHAR"/>
|
||||||
|
<xs:enumeration value="COLL"/>
|
||||||
|
<xs:enumeration value="CMDT"/>
|
||||||
|
<xs:enumeration value="COMC"/>
|
||||||
|
<xs:enumeration value="COMM"/>
|
||||||
|
<xs:enumeration value="COST"/>
|
||||||
|
<xs:enumeration value="CPYR"/>
|
||||||
|
<xs:enumeration value="DIVI"/>
|
||||||
|
<xs:enumeration value="FREX"/>
|
||||||
|
<xs:enumeration value="GDDS"/>
|
||||||
|
<xs:enumeration value="GOVT"/>
|
||||||
|
<xs:enumeration value="IHRP"/>
|
||||||
|
<xs:enumeration value="INTC"/>
|
||||||
|
<xs:enumeration value="INSU"/>
|
||||||
|
<xs:enumeration value="INTE"/>
|
||||||
|
<xs:enumeration value="LICF"/>
|
||||||
|
<xs:enumeration value="LOAN"/>
|
||||||
|
<xs:enumeration value="LOAR"/>
|
||||||
|
<xs:enumeration value="NETT"/>
|
||||||
|
<xs:enumeration value="PAYR"/>
|
||||||
|
<xs:enumeration value="PENS"/>
|
||||||
|
<xs:enumeration value="REFU"/>
|
||||||
|
<xs:enumeration value="RENT"/>
|
||||||
|
<xs:enumeration value="ROYA"/>
|
||||||
|
<xs:enumeration value="SCVE"/>
|
||||||
|
<xs:enumeration value="SECU"/>
|
||||||
|
<xs:enumeration value="SSBE"/>
|
||||||
|
<xs:enumeration value="SUBS"/>
|
||||||
|
<xs:enumeration value="TAXS"/>
|
||||||
|
<xs:enumeration value="VATX"/>
|
||||||
|
<xs:enumeration value="COMT"/>
|
||||||
|
<xs:enumeration value="DBTC"/>
|
||||||
|
<xs:enumeration value="SUPP"/>
|
||||||
|
<xs:enumeration value="HEDG"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PaymentSchemeChoice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="CashClearingSystem2Code"/>
|
||||||
|
<xs:element name="PrtryInf" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PercentageRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PersonIdentification2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="DrvrsLicNb" type="Max35Text"/>
|
||||||
|
<xs:element name="SclSctyNb" type="Max35Text"/>
|
||||||
|
<xs:element name="AlnRegnNb" type="Max35Text"/>
|
||||||
|
<xs:element name="PsptNb" type="Max35Text"/>
|
||||||
|
<xs:element name="TaxIdNb" type="Max35Text"/>
|
||||||
|
<xs:element name="IdntyCardNb" type="Max35Text"/>
|
||||||
|
<xs:element name="MplyrIdNb" type="Max35Text"/>
|
||||||
|
<xs:element name="OthrId" type="GenericIdentification4"/>
|
||||||
|
</xs:choice>
|
||||||
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PortugueseNCCIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="PT[0-9]{8,8}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PostalAddress1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="AdrTp" type="AddressType2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="AdrLine" type="Max70Text" minOccurs="0" maxOccurs="5"/>
|
||||||
|
<xs:element name="StrtNm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="BldgNb" type="Max16Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PstCd" type="Max16Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TwnNm" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CtrySubDvsn" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Ctry" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Priority2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="HIGH"/>
|
||||||
|
<xs:enumeration value="NORM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PurposeChoice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
<xs:element name="Cd" type="PaymentPurpose1Code"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentAmount1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="DuePyblAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="DscntApldAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="RmtdAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="CdtNoteAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="TaxAmt" type="CurrencyAndAmount"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceInformation3Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Ustrd" type="Max140Text"/>
|
||||||
|
<xs:element name="Strd" type="StructuredRemittanceInformation2"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RemittanceLocationMethod1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="FAXI"/>
|
||||||
|
<xs:enumeration value="EDIC"/>
|
||||||
|
<xs:enumeration value="URID"/>
|
||||||
|
<xs:enumeration value="EMAL"/>
|
||||||
|
<xs:enumeration value="POST"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="RussianCentralBankIdentificationCodeIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="RU[0-9]{9,9}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="SettlementPriorityChoice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Prty" type="Priority2Code"/>
|
||||||
|
<xs:element name="PmtSchme" type="PaymentSchemeChoice"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="SimpleIdentificationInformation">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="SmallNetworkIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="AU[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="SouthAfricanNCCIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="ZA[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="SpanishDomesticInterbankingIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="ES[0-9]{8,9}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="StructuredRegulatoryReporting2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Cd" type="Max3Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Amt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Inf" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRemittanceInformation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="RfrdDocTp" type="DocumentType1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RfrdDocRltdDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RfrdDocAmt" type="ReferredDocumentAmount1Choice" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xs:element name="DocRefNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrRef" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Invcr" type="PartyIdentification1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Invcee" type="PartyIdentification1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="SwissBCIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="SW[0-9]{3,5}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="SwissSICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="SW[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="TaxDetails">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CertId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxTp" type="TaxType" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdtrTaxId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrTaxTp" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DbtrTaxId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxRefNb" type="Max140Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TtlTaxblBaseAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TtlTaxAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxTpInf" type="TaxDetails" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxType">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CtgyDesc" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Rate" type="PercentageRate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxblBaseAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Amt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="UKDomesticSortCodeIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="SC[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="UPICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{8,17}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="pain.001.001.01">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="GrpHdr" type="GroupInformation1"/>
|
||||||
|
<xs:element name="PmtInf" type="PaymentInformation6" minOccurs="1" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,784 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--Generated by SWIFTStandards Workstation (build:R5.1.0.4) on 2006 Sep 08 11:58:39-->
|
||||||
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.02">
|
||||||
|
<xs:element name="Document" type="Document"/>
|
||||||
|
<xs:complexType name="AccountIdentification3Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="IBAN" type="IBANIdentifier"/>
|
||||||
|
<xs:element name="BBAN" type="BBANIdentifier"/>
|
||||||
|
<xs:element name="UPIC" type="UPICIdentifier"/>
|
||||||
|
<xs:element name="PrtryAcct" type="SimpleIdentificationInformation2"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="AddressType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="ADDR"/>
|
||||||
|
<xs:enumeration value="PBOX"/>
|
||||||
|
<xs:enumeration value="HOME"/>
|
||||||
|
<xs:enumeration value="BIZZ"/>
|
||||||
|
<xs:enumeration value="MLTO"/>
|
||||||
|
<xs:enumeration value="DLVY"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="AmountType2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="InstdAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="EqvtAmt" type="EquivalentAmount"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="BBANIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[a-zA-Z0-9]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BEIIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BaseOneRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BatchBookingIndicator">
|
||||||
|
<xs:restriction base="xs:boolean"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="BranchAndFinancialInstitutionIdentification3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification5Choice"/>
|
||||||
|
<xs:element name="BrnchId" type="BranchData" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="BranchData">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Nm" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CHIPSUniversalIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="CH[0-9]{6,6}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CashAccount7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="AccountIdentification3Choice"/>
|
||||||
|
<xs:element name="Tp" type="CashAccountType2" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Ccy" type="CurrencyCode" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccountType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="CashAccountType4Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CashAccountType4Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CASH"/>
|
||||||
|
<xs:enumeration value="CHAR"/>
|
||||||
|
<xs:enumeration value="COMM"/>
|
||||||
|
<xs:enumeration value="TAXE"/>
|
||||||
|
<xs:enumeration value="CISH"/>
|
||||||
|
<xs:enumeration value="TRAS"/>
|
||||||
|
<xs:enumeration value="SACC"/>
|
||||||
|
<xs:enumeration value="CACC"/>
|
||||||
|
<xs:enumeration value="SVGS"/>
|
||||||
|
<xs:enumeration value="ONDP"/>
|
||||||
|
<xs:enumeration value="MGLD"/>
|
||||||
|
<xs:enumeration value="NREX"/>
|
||||||
|
<xs:enumeration value="MOMA"/>
|
||||||
|
<xs:enumeration value="LOAN"/>
|
||||||
|
<xs:enumeration value="SLRY"/>
|
||||||
|
<xs:enumeration value="ODFT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ChargeBearerType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="SHAR"/>
|
||||||
|
<xs:enumeration value="SLEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Cheque5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="ChqTp" type="ChequeType2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChqNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChqFr" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DlvryMtd" type="ChequeDeliveryMethod1Choice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DlvrTo" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="InstrPrty" type="Priority2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChqMtrtyDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="FrmsCd" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="MemoFld" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RgnlClrZone" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PrtLctn" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeDelivery1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MLDB"/>
|
||||||
|
<xs:enumeration value="MLCD"/>
|
||||||
|
<xs:enumeration value="MLFA"/>
|
||||||
|
<xs:enumeration value="CRDB"/>
|
||||||
|
<xs:enumeration value="CRCD"/>
|
||||||
|
<xs:enumeration value="CRFA"/>
|
||||||
|
<xs:enumeration value="PUDB"/>
|
||||||
|
<xs:enumeration value="PUCD"/>
|
||||||
|
<xs:enumeration value="PUFA"/>
|
||||||
|
<xs:enumeration value="RGDB"/>
|
||||||
|
<xs:enumeration value="RGCD"/>
|
||||||
|
<xs:enumeration value="RGFA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ChequeDeliveryMethod1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ChequeDelivery1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CCHQ"/>
|
||||||
|
<xs:enumeration value="CCCH"/>
|
||||||
|
<xs:enumeration value="BCHQ"/>
|
||||||
|
<xs:enumeration value="DRFT"/>
|
||||||
|
<xs:enumeration value="ELDR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ClearingChannel2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="RTGS"/>
|
||||||
|
<xs:enumeration value="RTNS"/>
|
||||||
|
<xs:enumeration value="MPNS"/>
|
||||||
|
<xs:enumeration value="BOOK"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ClearingSystemMemberIdentification3Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Id" type="ExternalClearingSystemMemberCode"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CountryCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CreditTransferTransactionInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtId" type="PaymentIdentification1"/>
|
||||||
|
<xs:element name="PmtTpInf" type="PaymentTypeInformation1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Amt" type="AmountType2Choice"/>
|
||||||
|
<xs:element name="XchgRateInf" type="ExchangeRateInformation1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChrgBr" type="ChargeBearerType1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChqInstr" type="Cheque5" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="UltmtDbtr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IntrmyAgt1Acct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IntrmyAgt2Acct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IntrmyAgt3Acct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrAgtAcct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Cdtr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrAcct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="UltmtCdtr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="InstrForCdtrAgt" type="InstructionForCreditorAgent1" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xs:element name="InstrForDbtrAgt" type="Max140Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Purp" type="Purpose1Choice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RgltryRptg" type="RegulatoryReporting2" minOccurs="0" maxOccurs="10"/>
|
||||||
|
<xs:element name="Tax" type="TaxInformation2" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RltdRmtInf" type="RemittanceLocation1" minOccurs="0" maxOccurs="10"/>
|
||||||
|
<xs:element name="RmtInf" type="RemittanceInformation1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdtrRefTp" type="CreditorReferenceType1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrRef" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType3Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CurrencyAndAmount_SimpleType">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:minInclusive value="0"/>
|
||||||
|
<xs:fractionDigits value="5"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CurrencyAndAmount">
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="CurrencyAndAmount_SimpleType">
|
||||||
|
<xs:attribute name="Ccy" type="CurrencyCode" use="required"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CurrencyCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{3,3}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="DateAndPlaceOfBirth">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BirthDt" type="ISODate"/>
|
||||||
|
<xs:element name="PrvcOfBirth" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CityOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CtryOfBirth" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DecimalNumber">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="17"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Document">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="pain.001.001.02" type="pain.001.001.02"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DocumentType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MSIN"/>
|
||||||
|
<xs:enumeration value="CNFA"/>
|
||||||
|
<xs:enumeration value="DNFA"/>
|
||||||
|
<xs:enumeration value="CINV"/>
|
||||||
|
<xs:enumeration value="CREN"/>
|
||||||
|
<xs:enumeration value="DEBN"/>
|
||||||
|
<xs:enumeration value="HIRI"/>
|
||||||
|
<xs:enumeration value="SBIN"/>
|
||||||
|
<xs:enumeration value="CMCN"/>
|
||||||
|
<xs:enumeration value="SOAC"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="DocumentType3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="RADM"/>
|
||||||
|
<xs:enumeration value="RPIN"/>
|
||||||
|
<xs:enumeration value="FXDR"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="PUOR"/>
|
||||||
|
<xs:enumeration value="SCOR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="DunsIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{9,9}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="EANGLNIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{13,13}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="EquivalentAmount">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="CcyOfTrf" type="CurrencyCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ExchangeRateInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="XchgRate" type="BaseOneRate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RateTp" type="ExchangeRateType1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CtrctId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ExchangeRateType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="SPOT"/>
|
||||||
|
<xs:enumeration value="SALE"/>
|
||||||
|
<xs:enumeration value="AGRD"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalClearingSystemMemberCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalLocalInstrumentCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPurposeCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="FinancialInstitutionIdentification3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BIC" type="BICIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ClrSysMmbId" type="ClearingSystemMemberIdentification3Choice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PrtryId" type="GenericIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="FinancialInstitutionIdentification5Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="BIC" type="BICIdentifier"/>
|
||||||
|
<xs:element name="ClrSysMmbId" type="ClearingSystemMemberIdentification3Choice"/>
|
||||||
|
<xs:element name="NmAndAdr" type="NameAndAddress7"/>
|
||||||
|
<xs:element name="PrtryId" type="GenericIdentification3"/>
|
||||||
|
<xs:element name="CmbndId" type="FinancialInstitutionIdentification3"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericIdentification3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericIdentification4">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element name="IdTp" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GroupHeader1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="MsgId" type="Max35Text"/>
|
||||||
|
<xs:element name="CreDtTm" type="ISODateTime"/>
|
||||||
|
<xs:element name="Authstn" type="Max128Text" minOccurs="0" maxOccurs="2"/>
|
||||||
|
<xs:element name="BtchBookg" type="BatchBookingIndicator" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element name="CtrlSum" type="DecimalNumber" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Grpg" type="Grouping1Code"/>
|
||||||
|
<xs:element name="InitgPty" type="PartyIdentification8"/>
|
||||||
|
<xs:element name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Grouping1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="SNGL"/>
|
||||||
|
<xs:enumeration value="GRPD"/>
|
||||||
|
<xs:enumeration value="MIXD"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="IBANIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[a-zA-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="IBEIIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}[B-DF-HJ-NP-TV-XZ0-9]{7,7}[0-9]{1,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODate">
|
||||||
|
<xs:restriction base="xs:date"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODateTime">
|
||||||
|
<xs:restriction base="xs:dateTime"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Instruction3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHQB"/>
|
||||||
|
<xs:enumeration value="HOLD"/>
|
||||||
|
<xs:enumeration value="PHOB"/>
|
||||||
|
<xs:enumeration value="TELB"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="InstructionForCreditorAgent1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Cd" type="Instruction3Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="InstrInf" type="Max140Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="LocalInstrument1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalLocalInstrumentCode"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Max128Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="128"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max140Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="140"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max15NumericText">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{1,15}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max16Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="16"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max256Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="256"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max34Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="34"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max35Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max3Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="3"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max70Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="70"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="NameAndAddress3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max70Text"/>
|
||||||
|
<xs:element name="Adr" type="PostalAddress1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="NameAndAddress7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max70Text"/>
|
||||||
|
<xs:element name="PstlAdr" type="PostalAddress1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="OrganisationIdentification2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BIC" type="BICIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="IBEI" type="IBEIIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="BEI" type="BEIIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="EANGLN" type="EANGLNIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="USCHU" type="CHIPSUniversalIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DUNS" type="DunsIdentifier" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="BkPtyId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxIdNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PrtryId" type="GenericIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Party2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="OrgId" type="OrganisationIdentification2"/>
|
||||||
|
<xs:element name="PrvtId" type="PersonIdentification3" minOccurs="1" maxOccurs="4"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PartyIdentification8">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PstlAdr" type="PostalAddress1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Id" type="Party2Choice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CtryOfRes" type="CountryCode" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PaymentCategoryPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CORT"/>
|
||||||
|
<xs:enumeration value="SALA"/>
|
||||||
|
<xs:enumeration value="TREA"/>
|
||||||
|
<xs:enumeration value="CASH"/>
|
||||||
|
<xs:enumeration value="DIVI"/>
|
||||||
|
<xs:enumeration value="GOVT"/>
|
||||||
|
<xs:enumeration value="INTE"/>
|
||||||
|
<xs:enumeration value="LOAN"/>
|
||||||
|
<xs:enumeration value="PENS"/>
|
||||||
|
<xs:enumeration value="SECU"/>
|
||||||
|
<xs:enumeration value="SSBE"/>
|
||||||
|
<xs:enumeration value="SUPP"/>
|
||||||
|
<xs:enumeration value="TAXS"/>
|
||||||
|
<xs:enumeration value="TRAD"/>
|
||||||
|
<xs:enumeration value="VATX"/>
|
||||||
|
<xs:enumeration value="HEDG"/>
|
||||||
|
<xs:enumeration value="INTC"/>
|
||||||
|
<xs:enumeration value="WHLD"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PaymentIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="InstrId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="EndToEndId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentInstructionInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtInfId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PmtMtd" type="PaymentMethod3Code"/>
|
||||||
|
<xs:element name="PmtTpInf" type="PaymentTypeInformation1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ReqdExctnDt" type="ISODate"/>
|
||||||
|
<xs:element name="PoolgAdjstmntDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Dbtr" type="PartyIdentification8"/>
|
||||||
|
<xs:element name="DbtrAcct" type="CashAccount7"/>
|
||||||
|
<xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification3"/>
|
||||||
|
<xs:element name="DbtrAgtAcct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="UltmtDbtr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChrgBr" type="ChargeBearerType1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChrgsAcct" type="CashAccount7" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtTrfTxInf" type="CreditTransferTransactionInformation1" minOccurs="1" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PaymentMethod3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHK"/>
|
||||||
|
<xs:enumeration value="TRF"/>
|
||||||
|
<xs:enumeration value="TRA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PaymentTypeInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="InstrPrty" type="Priority2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="SvcLvl" type="ServiceLevel2Choice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="ClrChanl" type="ClearingChannel2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:choice>
|
||||||
|
<xs:element name="LclInstrm" type="LocalInstrument1Choice" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CtgyPurp" type="PaymentCategoryPurpose1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PercentageRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PersonIdentification3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="DrvrsLicNb" type="Max35Text"/>
|
||||||
|
<xs:element name="CstmrNb" type="Max35Text"/>
|
||||||
|
<xs:element name="SclSctyNb" type="Max35Text"/>
|
||||||
|
<xs:element name="AlnRegnNb" type="Max35Text"/>
|
||||||
|
<xs:element name="PsptNb" type="Max35Text"/>
|
||||||
|
<xs:element name="TaxIdNb" type="Max35Text"/>
|
||||||
|
<xs:element name="IdntyCardNb" type="Max35Text"/>
|
||||||
|
<xs:element name="MplyrIdNb" type="Max35Text"/>
|
||||||
|
<xs:element name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/>
|
||||||
|
<xs:element name="OthrId" type="GenericIdentification4"/>
|
||||||
|
</xs:choice>
|
||||||
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PostalAddress1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="AdrTp" type="AddressType2Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="AdrLine" type="Max70Text" minOccurs="0" maxOccurs="5"/>
|
||||||
|
<xs:element name="StrtNm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="BldgNb" type="Max16Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="PstCd" type="Max16Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TwnNm" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CtrySubDvsn" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Ctry" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Priority2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="HIGH"/>
|
||||||
|
<xs:enumeration value="NORM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Purpose1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPurposeCode"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentAmount1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="DuePyblAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="DscntApldAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="RmtdAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="CdtNoteAmt" type="CurrencyAndAmount"/>
|
||||||
|
<xs:element name="TaxAmt" type="CurrencyAndAmount"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="RfrdDocTp" type="ReferredDocumentType1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RfrdDocNb" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType2Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
<xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryAuthority">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="AuthrtyNm" type="Max70Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="AuthrtyCtry" type="CountryCode" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryReporting2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="DbtCdtRptgInd" type="RegulatoryReportingType1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Authrty" type="RegulatoryAuthority" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RgltryDtls" type="StructuredRegulatoryReporting2" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RegulatoryReportingType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="BOTH"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="RemittanceInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Ustrd" type="Max140Text" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xs:element name="Strd" type="StructuredRemittanceInformation6" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceLocation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="RmtId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RmtLctnMtd" type="RemittanceLocationMethod1Code" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RmtLctnElctrncAdr" type="Max256Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RmtLctnPstlAdr" type="NameAndAddress3" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RemittanceLocationMethod1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="FAXI"/>
|
||||||
|
<xs:enumeration value="EDIC"/>
|
||||||
|
<xs:enumeration value="URID"/>
|
||||||
|
<xs:enumeration value="EMAL"/>
|
||||||
|
<xs:enumeration value="POST"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ServiceLevel1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="SEPA"/>
|
||||||
|
<xs:enumeration value="SDVA"/>
|
||||||
|
<xs:enumeration value="PRPT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ServiceLevel2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ServiceLevel1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="SimpleIdentificationInformation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max34Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRegulatoryReporting2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Cd" type="Max3Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Amt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Inf" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRemittanceInformation6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="RfrdDocInf" type="ReferredDocumentInformation1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RfrdDocRltdDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="RfrdDocAmt" type="ReferredDocumentAmount1Choice" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
<xs:element name="CdtrRefInf" type="CreditorReferenceInformation1" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Invcr" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Invcee" type="PartyIdentification8" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="AddtlRmtInf" type="Max140Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxDetails">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CertId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxTp" type="TaxType" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxInformation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdtrTaxId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="CdtrTaxTp" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="DbtrTaxId" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxRefNb" type="Max140Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TtlTaxblBaseAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TtlTaxAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxDt" type="ISODate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxTpInf" type="TaxDetails" minOccurs="0" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxType">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CtgyDesc" type="Max35Text" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Rate" type="PercentageRate" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="TaxblBaseAmt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
<xs:element name="Amt" type="CurrencyAndAmount" minOccurs="0" maxOccurs="1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="UPICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{8,17}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="pain.001.001.02">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="GrpHdr" type="GroupHeader1"/>
|
||||||
|
<xs:element name="PmtInf" type="PaymentInstructionInformation1" minOccurs="1" maxOccurs="unbounded"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,921 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!--Generated by SWIFTStandards Workstation (build:R6.1.0.2) on 2009 Jan 08 17:30:53-->
|
||||||
|
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">
|
||||||
|
<xs:element name="Document" type="Document"/>
|
||||||
|
<xs:complexType name="AccountIdentification4Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="IBAN" type="IBAN2007Identifier"/>
|
||||||
|
<xs:element name="Othr" type="GenericAccountIdentification1"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="AccountSchemeName1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalAccountIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:minInclusive value="0"/>
|
||||||
|
<xs:fractionDigits value="5"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ActiveOrHistoricCurrencyAndAmount">
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
||||||
|
<xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ActiveOrHistoricCurrencyCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{3,3}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="AddressType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="ADDR"/>
|
||||||
|
<xs:enumeration value="PBOX"/>
|
||||||
|
<xs:enumeration value="HOME"/>
|
||||||
|
<xs:enumeration value="BIZZ"/>
|
||||||
|
<xs:enumeration value="MLTO"/>
|
||||||
|
<xs:enumeration value="DLVY"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="AmountType3Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element name="EqvtAmt" type="EquivalentAmount2"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="AnyBICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Authorisation1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="Authorisation1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max128Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Authorisation1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="AUTH"/>
|
||||||
|
<xs:enumeration value="FDET"/>
|
||||||
|
<xs:enumeration value="FSUM"/>
|
||||||
|
<xs:enumeration value="ILEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BaseOneRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BatchBookingIndicator">
|
||||||
|
<xs:restriction base="xs:boolean"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="BranchAndFinancialInstitutionIdentification4">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification7"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="BranchData2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccount16">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="AccountIdentification4Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccountType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="CashAccountType4Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CashAccountType4Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CASH"/>
|
||||||
|
<xs:enumeration value="CHAR"/>
|
||||||
|
<xs:enumeration value="COMM"/>
|
||||||
|
<xs:enumeration value="TAXE"/>
|
||||||
|
<xs:enumeration value="CISH"/>
|
||||||
|
<xs:enumeration value="TRAS"/>
|
||||||
|
<xs:enumeration value="SACC"/>
|
||||||
|
<xs:enumeration value="CACC"/>
|
||||||
|
<xs:enumeration value="SVGS"/>
|
||||||
|
<xs:enumeration value="ONDP"/>
|
||||||
|
<xs:enumeration value="MGLD"/>
|
||||||
|
<xs:enumeration value="NREX"/>
|
||||||
|
<xs:enumeration value="MOMA"/>
|
||||||
|
<xs:enumeration value="LOAN"/>
|
||||||
|
<xs:enumeration value="SLRY"/>
|
||||||
|
<xs:enumeration value="ODFT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CategoryPurpose1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalCategoryPurpose1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChargeBearerType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="SHAR"/>
|
||||||
|
<xs:enumeration value="SLEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Cheque6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqTp" type="ChequeType2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqNb" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqFr" type="NameAndAddress10"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DlvryMtd" type="ChequeDeliveryMethod1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DlvrTo" type="NameAndAddress10"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqMtrtyDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="2" minOccurs="0" name="MemoFld" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RgnlClrZone" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PrtLctn" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeDelivery1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MLDB"/>
|
||||||
|
<xs:enumeration value="MLCD"/>
|
||||||
|
<xs:enumeration value="MLFA"/>
|
||||||
|
<xs:enumeration value="CRDB"/>
|
||||||
|
<xs:enumeration value="CRCD"/>
|
||||||
|
<xs:enumeration value="CRFA"/>
|
||||||
|
<xs:enumeration value="PUDB"/>
|
||||||
|
<xs:enumeration value="PUCD"/>
|
||||||
|
<xs:enumeration value="PUFA"/>
|
||||||
|
<xs:enumeration value="RGDB"/>
|
||||||
|
<xs:enumeration value="RGCD"/>
|
||||||
|
<xs:enumeration value="RGFA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ChequeDeliveryMethod1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ChequeDelivery1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CCHQ"/>
|
||||||
|
<xs:enumeration value="CCCH"/>
|
||||||
|
<xs:enumeration value="BCHQ"/>
|
||||||
|
<xs:enumeration value="DRFT"/>
|
||||||
|
<xs:enumeration value="ELDR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ClearingSystemIdentification2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ClearingSystemMemberIdentification2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/>
|
||||||
|
<xs:element name="MmbId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ContactDetails2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CountryCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="CreditDebitCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRDT"/>
|
||||||
|
<xs:enumeration value="DBIT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CreditTransferTransactionInformation10">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtId" type="PaymentIdentification1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
|
||||||
|
<xs:element name="Amt" type="AmountType3Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="XchgRateInf" type="ExchangeRateInformation1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqInstr" type="Cheque6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification32"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification4"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1Acct" type="CashAccount16"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification4"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2Acct" type="CashAccount16"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification4"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3Acct" type="CashAccount16"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification4"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAgtAcct" type="CashAccount16"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="PartyIdentification32"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAcct" type="CashAccount16"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification32"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="InstrForCdtrAgt" type="InstructionForCreditorAgent1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Purp" type="Purpose2Choice"/>
|
||||||
|
<xs:element maxOccurs="10" minOccurs="0" name="RgltryRptg" type="RegulatoryReporting3"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tax" type="TaxInformation3"/>
|
||||||
|
<xs:element maxOccurs="10" minOccurs="0" name="RltdRmtInf" type="RemittanceLocation2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtInf" type="RemittanceInformation5"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceInformation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType3Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="CreditorReferenceType1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CustomerCreditTransferInitiationV03">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="GrpHdr" type="GroupHeader32"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="1" name="PmtInf" type="PaymentInstructionInformation3"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DateAndPlaceOfBirth">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BirthDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CityOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CtryOfBirth" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DatePeriodDetails">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FrDt" type="ISODate"/>
|
||||||
|
<xs:element name="ToDt" type="ISODate"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DecimalNumber">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="17"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Document">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV03"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DocumentAdjustment1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtDbtInd" type="CreditDebitCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Rsn" type="Max4Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DocumentType3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="RADM"/>
|
||||||
|
<xs:enumeration value="RPIN"/>
|
||||||
|
<xs:enumeration value="FXDR"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="PUOR"/>
|
||||||
|
<xs:enumeration value="SCOR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="DocumentType5Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MSIN"/>
|
||||||
|
<xs:enumeration value="CNFA"/>
|
||||||
|
<xs:enumeration value="DNFA"/>
|
||||||
|
<xs:enumeration value="CINV"/>
|
||||||
|
<xs:enumeration value="CREN"/>
|
||||||
|
<xs:enumeration value="DEBN"/>
|
||||||
|
<xs:enumeration value="HIRI"/>
|
||||||
|
<xs:enumeration value="SBIN"/>
|
||||||
|
<xs:enumeration value="CMCN"/>
|
||||||
|
<xs:enumeration value="SOAC"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="BOLD"/>
|
||||||
|
<xs:enumeration value="VCHR"/>
|
||||||
|
<xs:enumeration value="AROI"/>
|
||||||
|
<xs:enumeration value="TSUT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="EquivalentAmount2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element name="CcyOfTrf" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ExchangeRateInformation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="XchgRate" type="BaseOneRate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RateTp" type="ExchangeRateType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrctId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ExchangeRateType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="SPOT"/>
|
||||||
|
<xs:enumeration value="SALE"/>
|
||||||
|
<xs:enumeration value="AGRD"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalAccountIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalCategoryPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalClearingSystemIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="5"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalFinancialInstitutionIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalLocalInstrument1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalOrganisationIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPersonIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalServiceLevel1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="FinancialIdentificationSchemeName1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalFinancialInstitutionIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="FinancialInstitutionIdentification7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BIC" type="BICIdentifier"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Othr" type="GenericFinancialIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericAccountIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max34Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="AccountSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericFinancialIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="FinancialIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericOrganisationIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericPersonIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GroupHeader32">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="MsgId" type="Max35Text"/>
|
||||||
|
<xs:element name="CreDtTm" type="ISODateTime"/>
|
||||||
|
<xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/>
|
||||||
|
<xs:element name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
|
||||||
|
<xs:element name="InitgPty" type="PartyIdentification32"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification4"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="IBAN2007Identifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODate">
|
||||||
|
<xs:restriction base="xs:date"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODateTime">
|
||||||
|
<xs:restriction base="xs:dateTime"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Instruction3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHQB"/>
|
||||||
|
<xs:enumeration value="HOLD"/>
|
||||||
|
<xs:enumeration value="PHOB"/>
|
||||||
|
<xs:enumeration value="TELB"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="InstructionForCreditorAgent1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Instruction3Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="LocalInstrument2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalLocalInstrument1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Max10Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="10"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max128Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="128"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max140Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="140"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max15NumericText">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{1,15}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max16Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="16"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max2048Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="2048"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max34Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="34"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max35Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max4Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max70Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="70"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="NameAndAddress10">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element name="Adr" type="PostalAddress6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="NamePrefix1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DOCT"/>
|
||||||
|
<xs:enumeration value="MIST"/>
|
||||||
|
<xs:enumeration value="MISS"/>
|
||||||
|
<xs:enumeration value="MADM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Number">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="0"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="OrganisationIdentification4">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BICOrBEI" type="AnyBICIdentifier"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="OrganisationIdentificationSchemeName1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Party6Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="OrgId" type="OrganisationIdentification4"/>
|
||||||
|
<xs:element name="PrvtId" type="PersonIdentification5"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PartyIdentification32">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party6Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtctDtls" type="ContactDetails2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrId" type="Max35Text"/>
|
||||||
|
<xs:element name="EndToEndId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentInstructionInformation3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtInfId" type="Max35Text"/>
|
||||||
|
<xs:element name="PmtMtd" type="PaymentMethod3Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
|
||||||
|
<xs:element name="ReqdExctnDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PoolgAdjstmntDt" type="ISODate"/>
|
||||||
|
<xs:element name="Dbtr" type="PartyIdentification32"/>
|
||||||
|
<xs:element name="DbtrAcct" type="CashAccount16"/>
|
||||||
|
<xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification4"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtrAgtAcct" type="CashAccount16"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification32"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcct" type="CashAccount16"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification4"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="1" name="CdtTrfTxInf" type="CreditTransferTransactionInformation10"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PaymentMethod3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHK"/>
|
||||||
|
<xs:enumeration value="TRF"/>
|
||||||
|
<xs:enumeration value="TRA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PaymentTypeInformation19">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SvcLvl" type="ServiceLevel8Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="LclInstrm" type="LocalInstrument2Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtgyPurp" type="CategoryPurpose1Choice"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PercentageRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PersonIdentification5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericPersonIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PersonIdentificationSchemeName1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPersonIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PhoneNumber">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="\+[0-9]{1,3}-[0-9()+\-]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PostalAddress6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdrTp" type="AddressType2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dept" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="Max16Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="Max16Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Priority2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="HIGH"/>
|
||||||
|
<xs:enumeration value="NORM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Purpose2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPurpose1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentInformation3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ReferredDocumentType2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nb" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RltdDt" type="ISODate"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType5Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="ReferredDocumentType1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryAuthority2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryReporting3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtCdtRptgInd" type="RegulatoryReportingType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Authrty" type="RegulatoryAuthority2"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="StructuredRegulatoryReporting3"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RegulatoryReportingType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="BOTH"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="RemittanceAmount1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DuePyblAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DscntApldAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtNoteAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="AdjstmntAmtAndRsn" type="DocumentAdjustment1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceInformation5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Ustrd" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Strd" type="StructuredRemittanceInformation7"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceLocation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnMtd" type="RemittanceLocationMethod2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnElctrncAdr" type="Max2048Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnPstlAdr" type="NameAndAddress10"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RemittanceLocationMethod2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="FAXI"/>
|
||||||
|
<xs:enumeration value="EDIC"/>
|
||||||
|
<xs:enumeration value="URID"/>
|
||||||
|
<xs:enumeration value="EMAL"/>
|
||||||
|
<xs:enumeration value="POST"/>
|
||||||
|
<xs:enumeration value="SMSM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ServiceLevel8Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalServiceLevel1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRegulatoryReporting3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Max10Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Inf" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRemittanceInformation7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="RfrdDocInf" type="ReferredDocumentInformation3"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RfrdDocAmt" type="RemittanceAmount1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrRefInf" type="CreditorReferenceInformation2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Invcr" type="PartyIdentification32"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Invcee" type="PartyIdentification32"/>
|
||||||
|
<xs:element maxOccurs="3" minOccurs="0" name="AddtlRmtInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmount1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Rate" type="PercentageRate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="TaxRecordDetails1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAuthorisation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Titl" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxInformation3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdmstnZn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxParty1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxParty2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Authstn" type="TaxAuthorisation1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxPeriod1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Yr" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxRecordPeriod1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrToDt" type="DatePeriodDetails"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxRecord1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctgy" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtgyDtls" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtrSts" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CertId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="TaxAmount1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxRecordDetails1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="TaxRecordPeriod1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MM01"/>
|
||||||
|
<xs:enumeration value="MM02"/>
|
||||||
|
<xs:enumeration value="MM03"/>
|
||||||
|
<xs:enumeration value="MM04"/>
|
||||||
|
<xs:enumeration value="MM05"/>
|
||||||
|
<xs:enumeration value="MM06"/>
|
||||||
|
<xs:enumeration value="MM07"/>
|
||||||
|
<xs:enumeration value="MM08"/>
|
||||||
|
<xs:enumeration value="MM09"/>
|
||||||
|
<xs:enumeration value="MM10"/>
|
||||||
|
<xs:enumeration value="MM11"/>
|
||||||
|
<xs:enumeration value="MM12"/>
|
||||||
|
<xs:enumeration value="QTR1"/>
|
||||||
|
<xs:enumeration value="QTR2"/>
|
||||||
|
<xs:enumeration value="QTR3"/>
|
||||||
|
<xs:enumeration value="QTR4"/>
|
||||||
|
<xs:enumeration value="HLF1"/>
|
||||||
|
<xs:enumeration value="HLF2"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,968 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--Generated by SWIFTStandards Workstation (build:R7.1.30.4) on 2012 Jun 07 20:47:19-->
|
||||||
|
<xs:schema elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.04" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.04" xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
||||||
|
<xs:element name="Document" type="Document"/>
|
||||||
|
<xs:complexType name="AccountIdentification4Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="IBAN" type="IBAN2007Identifier"/>
|
||||||
|
<xs:element name="Othr" type="GenericAccountIdentification1"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="AccountSchemeName1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalAccountIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="5"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
<xs:minInclusive value="0"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ActiveOrHistoricCurrencyAndAmount">
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
||||||
|
<xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ActiveOrHistoricCurrencyCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{3,3}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="AddressType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="ADDR"/>
|
||||||
|
<xs:enumeration value="PBOX"/>
|
||||||
|
<xs:enumeration value="HOME"/>
|
||||||
|
<xs:enumeration value="BIZZ"/>
|
||||||
|
<xs:enumeration value="MLTO"/>
|
||||||
|
<xs:enumeration value="DLVY"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="AmountType3Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element name="EqvtAmt" type="EquivalentAmount2"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="AnyBICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Authorisation1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="Authorisation1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max128Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Authorisation1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="AUTH"/>
|
||||||
|
<xs:enumeration value="FDET"/>
|
||||||
|
<xs:enumeration value="FSUM"/>
|
||||||
|
<xs:enumeration value="ILEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BICFIIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BaseOneRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BatchBookingIndicator">
|
||||||
|
<xs:restriction base="xs:boolean"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="BranchAndFinancialInstitutionIdentification5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification8"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="BranchData2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccount24">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="AccountIdentification4Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccountType2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalCashAccountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CategoryPurpose1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalCategoryPurpose1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChargeBearerType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="SHAR"/>
|
||||||
|
<xs:enumeration value="SLEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Cheque7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqTp" type="ChequeType2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqNb" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqFr" type="NameAndAddress10"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DlvryMtd" type="ChequeDeliveryMethod1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DlvrTo" type="NameAndAddress10"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqMtrtyDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="2" minOccurs="0" name="MemoFld" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RgnlClrZone" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PrtLctn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="5" minOccurs="0" name="Sgntr" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeDelivery1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MLDB"/>
|
||||||
|
<xs:enumeration value="MLCD"/>
|
||||||
|
<xs:enumeration value="MLFA"/>
|
||||||
|
<xs:enumeration value="CRDB"/>
|
||||||
|
<xs:enumeration value="CRCD"/>
|
||||||
|
<xs:enumeration value="CRFA"/>
|
||||||
|
<xs:enumeration value="PUDB"/>
|
||||||
|
<xs:enumeration value="PUCD"/>
|
||||||
|
<xs:enumeration value="PUFA"/>
|
||||||
|
<xs:enumeration value="RGDB"/>
|
||||||
|
<xs:enumeration value="RGCD"/>
|
||||||
|
<xs:enumeration value="RGFA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ChequeDeliveryMethod1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ChequeDelivery1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CCHQ"/>
|
||||||
|
<xs:enumeration value="CCCH"/>
|
||||||
|
<xs:enumeration value="BCHQ"/>
|
||||||
|
<xs:enumeration value="DRFT"/>
|
||||||
|
<xs:enumeration value="ELDR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ClearingSystemIdentification2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ClearingSystemMemberIdentification2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/>
|
||||||
|
<xs:element name="MmbId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ContactDetails2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CountryCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="CreditDebitCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRDT"/>
|
||||||
|
<xs:enumeration value="DBIT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CreditTransferTransaction1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtId" type="PaymentIdentification1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
|
||||||
|
<xs:element name="Amt" type="AmountType3Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="XchgRateInf" type="ExchangeRate1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqInstr" type="Cheque7"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAgtAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="InstrForCdtrAgt" type="InstructionForCreditorAgent1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Purp" type="Purpose2Choice"/>
|
||||||
|
<xs:element maxOccurs="10" minOccurs="0" name="RgltryRptg" type="RegulatoryReporting3"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tax" type="TaxInformation3"/>
|
||||||
|
<xs:element maxOccurs="10" minOccurs="0" name="RltdRmtInf" type="RemittanceLocation2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtInf" type="RemittanceInformation7"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceInformation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType3Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="CreditorReferenceType1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CustomerCreditTransferInitiationV04">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="GrpHdr" type="GroupHeader48"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="1" name="PmtInf" type="PaymentInstruction6"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="SplmtryData" type="SupplementaryData1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DateAndPlaceOfBirth">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BirthDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CityOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CtryOfBirth" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DatePeriodDetails">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FrDt" type="ISODate"/>
|
||||||
|
<xs:element name="ToDt" type="ISODate"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DecimalNumber">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="17"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="DiscountAmountAndType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="DiscountAmountType1Choice"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DiscountAmountType1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalDiscountAmountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Document">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV04"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DocumentAdjustment1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtDbtInd" type="CreditDebitCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Rsn" type="Max4Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DocumentType3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="RADM"/>
|
||||||
|
<xs:enumeration value="RPIN"/>
|
||||||
|
<xs:enumeration value="FXDR"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="PUOR"/>
|
||||||
|
<xs:enumeration value="SCOR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="DocumentType5Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MSIN"/>
|
||||||
|
<xs:enumeration value="CNFA"/>
|
||||||
|
<xs:enumeration value="DNFA"/>
|
||||||
|
<xs:enumeration value="CINV"/>
|
||||||
|
<xs:enumeration value="CREN"/>
|
||||||
|
<xs:enumeration value="DEBN"/>
|
||||||
|
<xs:enumeration value="HIRI"/>
|
||||||
|
<xs:enumeration value="SBIN"/>
|
||||||
|
<xs:enumeration value="CMCN"/>
|
||||||
|
<xs:enumeration value="SOAC"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="BOLD"/>
|
||||||
|
<xs:enumeration value="VCHR"/>
|
||||||
|
<xs:enumeration value="AROI"/>
|
||||||
|
<xs:enumeration value="TSUT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="EquivalentAmount2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element name="CcyOfTrf" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ExchangeRate1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UnitCcy" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="XchgRate" type="BaseOneRate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RateTp" type="ExchangeRateType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrctId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ExchangeRateType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="SPOT"/>
|
||||||
|
<xs:enumeration value="SALE"/>
|
||||||
|
<xs:enumeration value="AGRD"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalAccountIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalCashAccountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalCategoryPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalClearingSystemIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="5"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalDiscountAmountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalFinancialInstitutionIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalLocalInstrument1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalOrganisationIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPersonIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalServiceLevel1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalTaxAmountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="FinancialIdentificationSchemeName1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalFinancialInstitutionIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="FinancialInstitutionIdentification8">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BICFI" type="BICFIIdentifier"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Othr" type="GenericFinancialIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericAccountIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max34Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="AccountSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericFinancialIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="FinancialIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericOrganisationIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericPersonIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GroupHeader48">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="MsgId" type="Max35Text"/>
|
||||||
|
<xs:element name="CreDtTm" type="ISODateTime"/>
|
||||||
|
<xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/>
|
||||||
|
<xs:element name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
|
||||||
|
<xs:element name="InitgPty" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="IBAN2007Identifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODate">
|
||||||
|
<xs:restriction base="xs:date"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODateTime">
|
||||||
|
<xs:restriction base="xs:dateTime"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Instruction3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHQB"/>
|
||||||
|
<xs:enumeration value="HOLD"/>
|
||||||
|
<xs:enumeration value="PHOB"/>
|
||||||
|
<xs:enumeration value="TELB"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="InstructionForCreditorAgent1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Instruction3Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="LocalInstrument2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalLocalInstrument1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Max10Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="10"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max128Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="128"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max140Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="140"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max15NumericText">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{1,15}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max16Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="16"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max2048Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="2048"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max34Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="34"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max350Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="350"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max35Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max4Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max70Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="70"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="NameAndAddress10">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element name="Adr" type="PostalAddress6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="NamePrefix1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DOCT"/>
|
||||||
|
<xs:enumeration value="MIST"/>
|
||||||
|
<xs:enumeration value="MISS"/>
|
||||||
|
<xs:enumeration value="MADM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Number">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="0"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="OrganisationIdentification8">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AnyBIC" type="AnyBICIdentifier"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="OrganisationIdentificationSchemeName1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Party11Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="OrgId" type="OrganisationIdentification8"/>
|
||||||
|
<xs:element name="PrvtId" type="PersonIdentification5"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PartyIdentification43">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party11Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtctDtls" type="ContactDetails2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrId" type="Max35Text"/>
|
||||||
|
<xs:element name="EndToEndId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentInstruction6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtInfId" type="Max35Text"/>
|
||||||
|
<xs:element name="PmtMtd" type="PaymentMethod3Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
|
||||||
|
<xs:element name="ReqdExctnDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PoolgAdjstmntDt" type="ISODate"/>
|
||||||
|
<xs:element name="Dbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element name="DbtrAcct" type="CashAccount24"/>
|
||||||
|
<xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtrAgtAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="1" name="CdtTrfTxInf" type="CreditTransferTransaction1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PaymentMethod3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHK"/>
|
||||||
|
<xs:enumeration value="TRF"/>
|
||||||
|
<xs:enumeration value="TRA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PaymentTypeInformation19">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SvcLvl" type="ServiceLevel8Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="LclInstrm" type="LocalInstrument2Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtgyPurp" type="CategoryPurpose1Choice"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PercentageRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PersonIdentification5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericPersonIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PersonIdentificationSchemeName1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPersonIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PhoneNumber">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="\+[0-9]{1,3}-[0-9()+\-]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PostalAddress6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdrTp" type="AddressType2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dept" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="Max16Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="Max16Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Priority2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="HIGH"/>
|
||||||
|
<xs:enumeration value="NORM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Purpose2Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPurpose1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentInformation3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ReferredDocumentType2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nb" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RltdDt" type="ISODate"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType5Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="ReferredDocumentType1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryAuthority2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryReporting3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtCdtRptgInd" type="RegulatoryReportingType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Authrty" type="RegulatoryAuthority2"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="StructuredRegulatoryReporting3"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RegulatoryReportingType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="BOTH"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="RemittanceAmount2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DuePyblAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="DscntApldAmt" type="DiscountAmountAndType1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtNoteAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="TaxAmt" type="TaxAmountAndType1"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="AdjstmntAmtAndRsn" type="DocumentAdjustment1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceInformation7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Ustrd" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Strd" type="StructuredRemittanceInformation9"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceLocation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnMtd" type="RemittanceLocationMethod2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnElctrncAdr" type="Max2048Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnPstlAdr" type="NameAndAddress10"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RemittanceLocationMethod2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="FAXI"/>
|
||||||
|
<xs:enumeration value="EDIC"/>
|
||||||
|
<xs:enumeration value="URID"/>
|
||||||
|
<xs:enumeration value="EMAL"/>
|
||||||
|
<xs:enumeration value="POST"/>
|
||||||
|
<xs:enumeration value="SMSM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ServiceLevel8Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalServiceLevel1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRegulatoryReporting3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Max10Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Inf" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRemittanceInformation9">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="RfrdDocInf" type="ReferredDocumentInformation3"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RfrdDocAmt" type="RemittanceAmount2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrRefInf" type="CreditorReferenceInformation2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Invcr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Invcee" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="3" minOccurs="0" name="AddtlRmtInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="SupplementaryData1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PlcAndNm" type="Max350Text"/>
|
||||||
|
<xs:element name="Envlp" type="SupplementaryDataEnvelope1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="SupplementaryDataEnvelope1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:any namespace="##any" processContents="lax"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmount1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Rate" type="PercentageRate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="TaxRecordDetails1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmountAndType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxAmountType1Choice"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmountType1Choice">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalTaxAmountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAuthorisation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Titl" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxInformation3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdmstnZn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxParty1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxParty2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Authstn" type="TaxAuthorisation1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxPeriod1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Yr" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxRecordPeriod1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrToDt" type="DatePeriodDetails"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxRecord1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctgy" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtgyDtls" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtrSts" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CertId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="TaxAmount1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxRecordDetails1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="TaxRecordPeriod1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MM01"/>
|
||||||
|
<xs:enumeration value="MM02"/>
|
||||||
|
<xs:enumeration value="MM03"/>
|
||||||
|
<xs:enumeration value="MM04"/>
|
||||||
|
<xs:enumeration value="MM05"/>
|
||||||
|
<xs:enumeration value="MM06"/>
|
||||||
|
<xs:enumeration value="MM07"/>
|
||||||
|
<xs:enumeration value="MM08"/>
|
||||||
|
<xs:enumeration value="MM09"/>
|
||||||
|
<xs:enumeration value="MM10"/>
|
||||||
|
<xs:enumeration value="MM11"/>
|
||||||
|
<xs:enumeration value="MM12"/>
|
||||||
|
<xs:enumeration value="QTR1"/>
|
||||||
|
<xs:enumeration value="QTR2"/>
|
||||||
|
<xs:enumeration value="QTR3"/>
|
||||||
|
<xs:enumeration value="QTR4"/>
|
||||||
|
<xs:enumeration value="HLF1"/>
|
||||||
|
<xs:enumeration value="HLF2"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,931 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--Generated by Standards Editor (build:R1.0.41.3) on 2013 Mar 05 13:39:40, ISO 20022 version : 2013-->
|
||||||
|
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.05" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.05">
|
||||||
|
<xs:element name="Document" type="Document"/>
|
||||||
|
<xs:complexType name="AccountIdentification4Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="IBAN" type="IBAN2007Identifier"/>
|
||||||
|
<xs:element name="Othr" type="GenericAccountIdentification1"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="AccountSchemeName1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalAccountIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="5"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
<xs:minInclusive value="0"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ActiveOrHistoricCurrencyAndAmount">
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
||||||
|
<xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ActiveOrHistoricCurrencyCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{3,3}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="AddressType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="ADDR"/>
|
||||||
|
<xs:enumeration value="PBOX"/>
|
||||||
|
<xs:enumeration value="HOME"/>
|
||||||
|
<xs:enumeration value="BIZZ"/>
|
||||||
|
<xs:enumeration value="MLTO"/>
|
||||||
|
<xs:enumeration value="DLVY"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="AmountType3Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element name="EqvtAmt" type="EquivalentAmount2"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="AnyBICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Authorisation1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="Authorisation1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max128Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Authorisation1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="AUTH"/>
|
||||||
|
<xs:enumeration value="FDET"/>
|
||||||
|
<xs:enumeration value="FSUM"/>
|
||||||
|
<xs:enumeration value="ILEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BICFIIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BaseOneRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BatchBookingIndicator">
|
||||||
|
<xs:restriction base="xs:boolean"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="BranchAndFinancialInstitutionIdentification5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification8"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="BranchData2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccount24">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="AccountIdentification4Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccountType2Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalCashAccountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CategoryPurpose1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalCategoryPurpose1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChargeBearerType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="SHAR"/>
|
||||||
|
<xs:enumeration value="SLEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Cheque7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqTp" type="ChequeType2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqNb" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqFr" type="NameAndAddress10"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DlvryMtd" type="ChequeDeliveryMethod1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DlvrTo" type="NameAndAddress10"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqMtrtyDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="2" minOccurs="0" name="MemoFld" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RgnlClrZone" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PrtLctn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="5" minOccurs="0" name="Sgntr" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeDelivery1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MLDB"/>
|
||||||
|
<xs:enumeration value="MLCD"/>
|
||||||
|
<xs:enumeration value="MLFA"/>
|
||||||
|
<xs:enumeration value="CRDB"/>
|
||||||
|
<xs:enumeration value="CRCD"/>
|
||||||
|
<xs:enumeration value="CRFA"/>
|
||||||
|
<xs:enumeration value="PUDB"/>
|
||||||
|
<xs:enumeration value="PUCD"/>
|
||||||
|
<xs:enumeration value="PUFA"/>
|
||||||
|
<xs:enumeration value="RGDB"/>
|
||||||
|
<xs:enumeration value="RGCD"/>
|
||||||
|
<xs:enumeration value="RGFA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ChequeDeliveryMethod1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ChequeDelivery1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CCHQ"/>
|
||||||
|
<xs:enumeration value="CCCH"/>
|
||||||
|
<xs:enumeration value="BCHQ"/>
|
||||||
|
<xs:enumeration value="DRFT"/>
|
||||||
|
<xs:enumeration value="ELDR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ClearingSystemIdentification2Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ClearingSystemMemberIdentification2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/>
|
||||||
|
<xs:element name="MmbId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ContactDetails2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CountryCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="CreditDebitCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRDT"/>
|
||||||
|
<xs:enumeration value="DBIT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CreditTransferTransaction6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtId" type="PaymentIdentification1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
|
||||||
|
<xs:element name="Amt" type="AmountType3Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="XchgRateInf" type="ExchangeRate1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqInstr" type="Cheque7"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAgtAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="InstrForCdtrAgt" type="InstructionForCreditorAgent1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Purp" type="Purpose2Choice"/>
|
||||||
|
<xs:element maxOccurs="10" minOccurs="0" name="RgltryRptg" type="RegulatoryReporting3"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tax" type="TaxInformation3"/>
|
||||||
|
<xs:element maxOccurs="10" minOccurs="0" name="RltdRmtInf" type="RemittanceLocation2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtInf" type="RemittanceInformation7"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="SplmtryData" type="SupplementaryData1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceInformation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType3Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="CreditorReferenceType1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CustomerCreditTransferInitiationV05">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="GrpHdr" type="GroupHeader48"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="1" name="PmtInf" type="PaymentInstruction9"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="SplmtryData" type="SupplementaryData1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DateAndPlaceOfBirth">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BirthDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CityOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CtryOfBirth" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DatePeriodDetails">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FrDt" type="ISODate"/>
|
||||||
|
<xs:element name="ToDt" type="ISODate"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DecimalNumber">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="17"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="DiscountAmountAndType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="DiscountAmountType1Choice"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DiscountAmountType1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalDiscountAmountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Document">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV05"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DocumentAdjustment1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtDbtInd" type="CreditDebitCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Rsn" type="Max4Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DocumentType3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="RADM"/>
|
||||||
|
<xs:enumeration value="RPIN"/>
|
||||||
|
<xs:enumeration value="FXDR"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="PUOR"/>
|
||||||
|
<xs:enumeration value="SCOR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="DocumentType5Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MSIN"/>
|
||||||
|
<xs:enumeration value="CNFA"/>
|
||||||
|
<xs:enumeration value="DNFA"/>
|
||||||
|
<xs:enumeration value="CINV"/>
|
||||||
|
<xs:enumeration value="CREN"/>
|
||||||
|
<xs:enumeration value="DEBN"/>
|
||||||
|
<xs:enumeration value="HIRI"/>
|
||||||
|
<xs:enumeration value="SBIN"/>
|
||||||
|
<xs:enumeration value="CMCN"/>
|
||||||
|
<xs:enumeration value="SOAC"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="BOLD"/>
|
||||||
|
<xs:enumeration value="VCHR"/>
|
||||||
|
<xs:enumeration value="AROI"/>
|
||||||
|
<xs:enumeration value="TSUT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="EquivalentAmount2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element name="CcyOfTrf" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ExchangeRate1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UnitCcy" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="XchgRate" type="BaseOneRate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RateTp" type="ExchangeRateType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrctId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ExchangeRateType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="SPOT"/>
|
||||||
|
<xs:enumeration value="SALE"/>
|
||||||
|
<xs:enumeration value="AGRD"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalAccountIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalCashAccountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalCategoryPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalClearingSystemIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="5"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalDiscountAmountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalFinancialInstitutionIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalLocalInstrument1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalOrganisationIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPersonIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalServiceLevel1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalTaxAmountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="FinancialIdentificationSchemeName1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalFinancialInstitutionIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="FinancialInstitutionIdentification8">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BICFI" type="BICFIIdentifier"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Othr" type="GenericFinancialIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericAccountIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max34Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="AccountSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericFinancialIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="FinancialIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericOrganisationIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericPersonIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GroupHeader48">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="MsgId" type="Max35Text"/>
|
||||||
|
<xs:element name="CreDtTm" type="ISODateTime"/>
|
||||||
|
<xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/>
|
||||||
|
<xs:element name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
|
||||||
|
<xs:element name="InitgPty" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="IBAN2007Identifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODate">
|
||||||
|
<xs:restriction base="xs:date"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODateTime">
|
||||||
|
<xs:restriction base="xs:dateTime"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Instruction3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHQB"/>
|
||||||
|
<xs:enumeration value="HOLD"/>
|
||||||
|
<xs:enumeration value="PHOB"/>
|
||||||
|
<xs:enumeration value="TELB"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="InstructionForCreditorAgent1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Instruction3Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="LocalInstrument2Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalLocalInstrument1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Max10Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="10"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max128Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="128"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max140Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="140"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max15NumericText">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{1,15}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max16Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="16"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max2048Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="2048"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max34Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="34"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max350Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="350"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max35Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max4Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max70Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="70"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="NameAndAddress10">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element name="Adr" type="PostalAddress6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="NamePrefix1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DOCT"/>
|
||||||
|
<xs:enumeration value="MIST"/>
|
||||||
|
<xs:enumeration value="MISS"/>
|
||||||
|
<xs:enumeration value="MADM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Number">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="0"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="OrganisationIdentification8">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AnyBIC" type="AnyBICIdentifier"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="OrganisationIdentificationSchemeName1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Party11Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="OrgId" type="OrganisationIdentification8"/>
|
||||||
|
<xs:element name="PrvtId" type="PersonIdentification5"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PartyIdentification43">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party11Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtctDtls" type="ContactDetails2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrId" type="Max35Text"/>
|
||||||
|
<xs:element name="EndToEndId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentInstruction9">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtInfId" type="Max35Text"/>
|
||||||
|
<xs:element name="PmtMtd" type="PaymentMethod3Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
|
||||||
|
<xs:element name="ReqdExctnDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PoolgAdjstmntDt" type="ISODate"/>
|
||||||
|
<xs:element name="Dbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element name="DbtrAcct" type="CashAccount24"/>
|
||||||
|
<xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtrAgtAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="1" name="CdtTrfTxInf" type="CreditTransferTransaction6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PaymentMethod3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHK"/>
|
||||||
|
<xs:enumeration value="TRF"/>
|
||||||
|
<xs:enumeration value="TRA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PaymentTypeInformation19">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SvcLvl" type="ServiceLevel8Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="LclInstrm" type="LocalInstrument2Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtgyPurp" type="CategoryPurpose1Choice"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PercentageRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PersonIdentification5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericPersonIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PersonIdentificationSchemeName1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPersonIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PhoneNumber">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="\+[0-9]{1,3}-[0-9()+\-]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PostalAddress6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdrTp" type="AddressType2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dept" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="Max16Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="Max16Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Priority2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="HIGH"/>
|
||||||
|
<xs:enumeration value="NORM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Purpose2Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPurpose1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentInformation3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ReferredDocumentType2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nb" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RltdDt" type="ISODate"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType5Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="ReferredDocumentType1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryAuthority2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryReporting3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtCdtRptgInd" type="RegulatoryReportingType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Authrty" type="RegulatoryAuthority2"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="StructuredRegulatoryReporting3"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RegulatoryReportingType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="BOTH"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="RemittanceAmount2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DuePyblAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="DscntApldAmt" type="DiscountAmountAndType1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtNoteAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="TaxAmt" type="TaxAmountAndType1"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="AdjstmntAmtAndRsn" type="DocumentAdjustment1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceInformation7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Ustrd" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Strd" type="StructuredRemittanceInformation9"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceLocation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnMtd" type="RemittanceLocationMethod2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnElctrncAdr" type="Max2048Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtLctnPstlAdr" type="NameAndAddress10"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RemittanceLocationMethod2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="FAXI"/>
|
||||||
|
<xs:enumeration value="EDIC"/>
|
||||||
|
<xs:enumeration value="URID"/>
|
||||||
|
<xs:enumeration value="EMAL"/>
|
||||||
|
<xs:enumeration value="POST"/>
|
||||||
|
<xs:enumeration value="SMSM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ServiceLevel8Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalServiceLevel1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRegulatoryReporting3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Max10Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Inf" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRemittanceInformation9">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="RfrdDocInf" type="ReferredDocumentInformation3"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RfrdDocAmt" type="RemittanceAmount2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrRefInf" type="CreditorReferenceInformation2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Invcr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Invcee" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="3" minOccurs="0" name="AddtlRmtInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="SupplementaryData1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PlcAndNm" type="Max350Text"/>
|
||||||
|
<xs:element name="Envlp" type="SupplementaryDataEnvelope1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="SupplementaryDataEnvelope1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:any namespace="##any" processContents="lax"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmount1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Rate" type="PercentageRate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="TaxRecordDetails1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmountAndType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxAmountType1Choice"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmountType1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalTaxAmountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAuthorisation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Titl" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxInformation3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdmstnZn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxParty1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxParty2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Authstn" type="TaxAuthorisation1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxPeriod1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Yr" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxRecordPeriod1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrToDt" type="DatePeriodDetails"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxRecord1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctgy" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtgyDtls" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtrSts" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CertId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="TaxAmount1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxRecordDetails1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="TaxRecordPeriod1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MM01"/>
|
||||||
|
<xs:enumeration value="MM02"/>
|
||||||
|
<xs:enumeration value="MM03"/>
|
||||||
|
<xs:enumeration value="MM04"/>
|
||||||
|
<xs:enumeration value="MM05"/>
|
||||||
|
<xs:enumeration value="MM06"/>
|
||||||
|
<xs:enumeration value="MM07"/>
|
||||||
|
<xs:enumeration value="MM08"/>
|
||||||
|
<xs:enumeration value="MM09"/>
|
||||||
|
<xs:enumeration value="MM10"/>
|
||||||
|
<xs:enumeration value="MM11"/>
|
||||||
|
<xs:enumeration value="MM12"/>
|
||||||
|
<xs:enumeration value="QTR1"/>
|
||||||
|
<xs:enumeration value="QTR2"/>
|
||||||
|
<xs:enumeration value="QTR3"/>
|
||||||
|
<xs:enumeration value="QTR4"/>
|
||||||
|
<xs:enumeration value="HLF1"/>
|
||||||
|
<xs:enumeration value="HLF2"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
</xs:schema>
|
||||||
@@ -0,0 +1,987 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--Generated by Standards Editor (build:R1.6.5.2_DEV) on 2015 Feb 24 14:08:25, ISO 20022 version : 2013-->
|
||||||
|
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.06" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:pain.001.001.06">
|
||||||
|
<xs:element name="Document" type="Document"/>
|
||||||
|
<xs:complexType name="AccountIdentification4Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="IBAN" type="IBAN2007Identifier"/>
|
||||||
|
<xs:element name="Othr" type="GenericAccountIdentification1"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="AccountSchemeName1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalAccountIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="5"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
<xs:minInclusive value="0"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ActiveOrHistoricCurrencyAndAmount">
|
||||||
|
<xs:simpleContent>
|
||||||
|
<xs:extension base="ActiveOrHistoricCurrencyAndAmount_SimpleType">
|
||||||
|
<xs:attribute name="Ccy" type="ActiveOrHistoricCurrencyCode" use="required"/>
|
||||||
|
</xs:extension>
|
||||||
|
</xs:simpleContent>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ActiveOrHistoricCurrencyCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{3,3}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="AddressType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="ADDR"/>
|
||||||
|
<xs:enumeration value="PBOX"/>
|
||||||
|
<xs:enumeration value="HOME"/>
|
||||||
|
<xs:enumeration value="BIZZ"/>
|
||||||
|
<xs:enumeration value="MLTO"/>
|
||||||
|
<xs:enumeration value="DLVY"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="AmountType4Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="InstdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element name="EqvtAmt" type="EquivalentAmount2"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="AnyBICIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Authorisation1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="Authorisation1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max128Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Authorisation1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="AUTH"/>
|
||||||
|
<xs:enumeration value="FDET"/>
|
||||||
|
<xs:enumeration value="FSUM"/>
|
||||||
|
<xs:enumeration value="ILEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BICFIIdentifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{6,6}[A-Z2-9][A-NP-Z0-9]([A-Z0-9]{3,3}){0,1}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BaseOneRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="BatchBookingIndicator">
|
||||||
|
<xs:restriction base="xs:boolean"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="BranchAndFinancialInstitutionIdentification5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification8"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BrnchId" type="BranchData2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="BranchData2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccount24">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="AccountIdentification4Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CashAccountType2Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ccy" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CashAccountType2Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalCashAccountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CategoryPurpose1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalCategoryPurpose1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChargeBearerType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="SHAR"/>
|
||||||
|
<xs:enumeration value="SLEV"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Cheque7">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqTp" type="ChequeType2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqNb" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqFr" type="NameAndAddress10"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DlvryMtd" type="ChequeDeliveryMethod1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DlvrTo" type="NameAndAddress10"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqMtrtyDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="2" minOccurs="0" name="MemoFld" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RgnlClrZone" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PrtLctn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="5" minOccurs="0" name="Sgntr" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeDelivery1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MLDB"/>
|
||||||
|
<xs:enumeration value="MLCD"/>
|
||||||
|
<xs:enumeration value="MLFA"/>
|
||||||
|
<xs:enumeration value="CRDB"/>
|
||||||
|
<xs:enumeration value="CRCD"/>
|
||||||
|
<xs:enumeration value="CRFA"/>
|
||||||
|
<xs:enumeration value="PUDB"/>
|
||||||
|
<xs:enumeration value="PUCD"/>
|
||||||
|
<xs:enumeration value="PUFA"/>
|
||||||
|
<xs:enumeration value="RGDB"/>
|
||||||
|
<xs:enumeration value="RGCD"/>
|
||||||
|
<xs:enumeration value="RGFA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ChequeDeliveryMethod1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ChequeDelivery1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ChequeType2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CCHQ"/>
|
||||||
|
<xs:enumeration value="CCCH"/>
|
||||||
|
<xs:enumeration value="BCHQ"/>
|
||||||
|
<xs:enumeration value="DRFT"/>
|
||||||
|
<xs:enumeration value="ELDR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ClearingSystemIdentification2Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ClearingSystemMemberIdentification2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysId" type="ClearingSystemIdentification2Choice"/>
|
||||||
|
<xs:element name="MmbId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ContactDetails2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="NmPrfx" type="NamePrefix1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PhneNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="MobNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FaxNb" type="PhoneNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="EmailAdr" type="Max2048Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Othr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="CountryCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="CreditDebitCode">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRDT"/>
|
||||||
|
<xs:enumeration value="DBIT"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="CreditTransferTransaction20">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtId" type="PaymentIdentification1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
|
||||||
|
<xs:element name="Amt" type="AmountType4Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="XchgRateInf" type="ExchangeRate1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChqInstr" type="Cheque7"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt1Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt2Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="IntrmyAgt3Acct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAgtAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtCdtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="InstrForCdtrAgt" type="InstructionForCreditorAgent1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Purp" type="Purpose2Choice"/>
|
||||||
|
<xs:element maxOccurs="10" minOccurs="0" name="RgltryRptg" type="RegulatoryReporting3"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tax" type="TaxInformation3"/>
|
||||||
|
<xs:element maxOccurs="10" minOccurs="0" name="RltdRmtInf" type="RemittanceLocation4"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtInf" type="RemittanceInformation10"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="SplmtryData" type="SupplementaryData1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceInformation2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="CreditorReferenceType2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ref" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType3Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CreditorReferenceType2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="CreditorReferenceType1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="CustomerCreditTransferInitiationV06">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="GrpHdr" type="GroupHeader48"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="1" name="PmtInf" type="PaymentInstruction16"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="SplmtryData" type="SupplementaryData1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DateAndPlaceOfBirth">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="BirthDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CityOfBirth" type="Max35Text"/>
|
||||||
|
<xs:element name="CtryOfBirth" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DatePeriodDetails">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="FrDt" type="ISODate"/>
|
||||||
|
<xs:element name="ToDt" type="ISODate"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DecimalNumber">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="17"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="DiscountAmountAndType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="DiscountAmountType1Choice"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DiscountAmountType1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalDiscountAmountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Document">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CstmrCdtTrfInitn" type="CustomerCreditTransferInitiationV06"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="DocumentAdjustment1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtDbtInd" type="CreditDebitCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Rsn" type="Max4Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="DocumentType3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="RADM"/>
|
||||||
|
<xs:enumeration value="RPIN"/>
|
||||||
|
<xs:enumeration value="FXDR"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="PUOR"/>
|
||||||
|
<xs:enumeration value="SCOR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="DocumentType6Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MSIN"/>
|
||||||
|
<xs:enumeration value="CNFA"/>
|
||||||
|
<xs:enumeration value="DNFA"/>
|
||||||
|
<xs:enumeration value="CINV"/>
|
||||||
|
<xs:enumeration value="CREN"/>
|
||||||
|
<xs:enumeration value="DEBN"/>
|
||||||
|
<xs:enumeration value="HIRI"/>
|
||||||
|
<xs:enumeration value="SBIN"/>
|
||||||
|
<xs:enumeration value="CMCN"/>
|
||||||
|
<xs:enumeration value="SOAC"/>
|
||||||
|
<xs:enumeration value="DISP"/>
|
||||||
|
<xs:enumeration value="BOLD"/>
|
||||||
|
<xs:enumeration value="VCHR"/>
|
||||||
|
<xs:enumeration value="AROI"/>
|
||||||
|
<xs:enumeration value="TSUT"/>
|
||||||
|
<xs:enumeration value="PUOR"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="EquivalentAmount2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element name="CcyOfTrf" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ExchangeRate1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UnitCcy" type="ActiveOrHistoricCurrencyCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="XchgRate" type="BaseOneRate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RateTp" type="ExchangeRateType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrctId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="ExchangeRateType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="SPOT"/>
|
||||||
|
<xs:enumeration value="SALE"/>
|
||||||
|
<xs:enumeration value="AGRD"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalAccountIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalCashAccountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalCategoryPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalClearingSystemIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="5"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalDiscountAmountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalFinancialInstitutionIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalGarnishmentType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalLocalInstrument1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalOrganisationIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPersonIdentification1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalPurpose1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalServiceLevel1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ExternalTaxAmountType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="FinancialIdentificationSchemeName1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalFinancialInstitutionIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="FinancialInstitutionIdentification8">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BICFI" type="BICFIIdentifier"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Othr" type="GenericFinancialIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Garnishment1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Tp" type="GarnishmentType1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Grnshee" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="GrnshmtAdmstr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FmlyMdclInsrncInd" type="TrueFalseIndicator"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="MplyeeTermntnInd" type="TrueFalseIndicator"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GarnishmentType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="GarnishmentType1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GarnishmentType1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalGarnishmentType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericAccountIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max34Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="AccountSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericFinancialIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="FinancialIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericOrganisationIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GenericPersonIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Id" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="GroupHeader48">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="MsgId" type="Max35Text"/>
|
||||||
|
<xs:element name="CreDtTm" type="ISODateTime"/>
|
||||||
|
<xs:element maxOccurs="2" minOccurs="0" name="Authstn" type="Authorisation1Choice"/>
|
||||||
|
<xs:element name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
|
||||||
|
<xs:element name="InitgPty" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FwdgAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="IBAN2007Identifier">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[A-Z]{2,2}[0-9]{2,2}[a-zA-Z0-9]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODate">
|
||||||
|
<xs:restriction base="xs:date"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="ISODateTime">
|
||||||
|
<xs:restriction base="xs:dateTime"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Instruction3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHQB"/>
|
||||||
|
<xs:enumeration value="HOLD"/>
|
||||||
|
<xs:enumeration value="PHOB"/>
|
||||||
|
<xs:enumeration value="TELB"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="InstructionForCreditorAgent1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Instruction3Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="LocalInstrument2Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalLocalInstrument1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Max10Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="10"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max128Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="128"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max140Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="140"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max15NumericText">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="[0-9]{1,15}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max16Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="16"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max2048Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="2048"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max34Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="34"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max350Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="350"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max35Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="35"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max4Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="4"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Max70Text">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:minLength value="1"/>
|
||||||
|
<xs:maxLength value="70"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="NameAndAddress10">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element name="Adr" type="PostalAddress6"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="NamePrefix1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="DOCT"/>
|
||||||
|
<xs:enumeration value="MIST"/>
|
||||||
|
<xs:enumeration value="MISS"/>
|
||||||
|
<xs:enumeration value="MADM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="Number">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="0"/>
|
||||||
|
<xs:totalDigits value="18"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="OrganisationIdentification8">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AnyBIC" type="AnyBICIdentifier"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="OrganisationIdentificationSchemeName1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="Party11Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="OrgId" type="OrganisationIdentification8"/>
|
||||||
|
<xs:element name="PrvtId" type="PersonIdentification5"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PartyIdentification43">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party11Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtctDtls" type="ContactDetails2"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentIdentification1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrId" type="Max35Text"/>
|
||||||
|
<xs:element name="EndToEndId" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PaymentInstruction16">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="PmtInfId" type="Max35Text"/>
|
||||||
|
<xs:element name="PmtMtd" type="PaymentMethod3Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BtchBookg" type="BatchBookingIndicator"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="NbOfTxs" type="Max15NumericText"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrlSum" type="DecimalNumber"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PmtTpInf" type="PaymentTypeInformation19"/>
|
||||||
|
<xs:element name="ReqdExctnDt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PoolgAdjstmntDt" type="ISODate"/>
|
||||||
|
<xs:element name="Dbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element name="DbtrAcct" type="CashAccount24"/>
|
||||||
|
<xs:element name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtrAgtAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrForDbtrAgt" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgBr" type="ChargeBearerType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcct" type="CashAccount24"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ChrgsAcctAgt" type="BranchAndFinancialInstitutionIdentification5"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="1" name="CdtTrfTxInf" type="CreditTransferTransaction20"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PaymentMethod3Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CHK"/>
|
||||||
|
<xs:enumeration value="TRF"/>
|
||||||
|
<xs:enumeration value="TRA"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PaymentTypeInformation19">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="InstrPrty" type="Priority2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SvcLvl" type="ServiceLevel8Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="LclInstrm" type="LocalInstrument2Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtgyPurp" type="CategoryPurpose1Choice"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PercentageRate">
|
||||||
|
<xs:restriction base="xs:decimal">
|
||||||
|
<xs:fractionDigits value="10"/>
|
||||||
|
<xs:totalDigits value="11"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PersonIdentification5">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Othr" type="GenericPersonIdentification1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="PersonIdentificationSchemeName1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPersonIdentification1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="PhoneNumber">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:pattern value="\+[0-9]{1,3}-[0-9()+\-]{1,30}"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="PostalAddress6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdrTp" type="AddressType2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dept" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="Max70Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="Max16Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="Max16Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="7" minOccurs="0" name="AdrLine" type="Max70Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="Priority2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="HIGH"/>
|
||||||
|
<xs:enumeration value="NORM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="Purpose2Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalPurpose1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentInformation6">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="ReferredDocumentType4"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nb" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RltdDt" type="ISODate"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType3Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="DocumentType6Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="ReferredDocumentType4">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="CdOrPrtry" type="ReferredDocumentType3Choice"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryAuthority2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RegulatoryReporting3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtCdtRptgInd" type="RegulatoryReportingType1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Authrty" type="RegulatoryAuthority2"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="StructuredRegulatoryReporting3"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RegulatoryReportingType1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="CRED"/>
|
||||||
|
<xs:enumeration value="DEBT"/>
|
||||||
|
<xs:enumeration value="BOTH"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="RemittanceAmount2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DuePyblAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="DscntApldAmt" type="DiscountAmountAndType1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtNoteAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="TaxAmt" type="TaxAmountAndType1"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="AdjstmntAmtAndRsn" type="DocumentAdjustment1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtdAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceInformation10">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Ustrd" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Strd" type="StructuredRemittanceInformation12"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceLocation4">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RmtId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="RmtLctnDtls" type="RemittanceLocationDetails1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="RemittanceLocationDetails1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element name="Mtd" type="RemittanceLocationMethod2Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="ElctrncAdr" type="Max2048Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="NameAndAddress10"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="RemittanceLocationMethod2Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="FAXI"/>
|
||||||
|
<xs:enumeration value="EDIC"/>
|
||||||
|
<xs:enumeration value="URID"/>
|
||||||
|
<xs:enumeration value="EMAL"/>
|
||||||
|
<xs:enumeration value="POST"/>
|
||||||
|
<xs:enumeration value="SMSM"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:complexType name="ServiceLevel8Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalServiceLevel1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRegulatoryReporting3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cd" type="Max10Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Inf" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="StructuredRemittanceInformation12">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="RfrdDocInf" type="ReferredDocumentInformation6"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RfrdDocAmt" type="RemittanceAmount2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CdtrRefInf" type="CreditorReferenceInformation2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Invcr" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Invcee" type="PartyIdentification43"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxRmt" type="TaxInformation4"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="GrnshmtRmt" type="Garnishment1"/>
|
||||||
|
<xs:element maxOccurs="3" minOccurs="0" name="AddtlRmtInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="SupplementaryData1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="PlcAndNm" type="Max350Text"/>
|
||||||
|
<xs:element name="Envlp" type="SupplementaryDataEnvelope1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="SupplementaryDataEnvelope1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:any namespace="##any" processContents="lax"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmount1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Rate" type="PercentageRate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Dtls" type="TaxRecordDetails1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmountAndType1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxAmountType1Choice"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAmountType1Choice">
|
||||||
|
<xs:choice>
|
||||||
|
<xs:element name="Cd" type="ExternalTaxAmountType1Code"/>
|
||||||
|
<xs:element name="Prtry" type="Max35Text"/>
|
||||||
|
</xs:choice>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxAuthorisation1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Titl" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxInformation3">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdmstnZn" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxInformation4">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Cdtr" type="TaxParty1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="TaxParty2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="UltmtDbtr" type="TaxParty2"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AdmstnZone" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RefNb" type="Max140Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Mtd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxblBaseAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TtlTaxAmt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Dt" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="SeqNb" type="Number"/>
|
||||||
|
<xs:element maxOccurs="unbounded" minOccurs="0" name="Rcrd" type="TaxRecord1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxParty1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxParty2">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="RegnId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxTp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Authstn" type="TaxAuthorisation1"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxPeriod1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Yr" type="ISODate"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="TaxRecordPeriod1Code"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrToDt" type="DatePeriodDetails"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxRecord1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Tp" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Ctgy" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CtgyDtls" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="DbtrSts" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="CertId" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="FrmsCd" type="Max35Text"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="TaxAmt" type="TaxAmount1"/>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="AddtlInf" type="Max140Text"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:complexType name="TaxRecordDetails1">
|
||||||
|
<xs:sequence>
|
||||||
|
<xs:element maxOccurs="1" minOccurs="0" name="Prd" type="TaxPeriod1"/>
|
||||||
|
<xs:element name="Amt" type="ActiveOrHistoricCurrencyAndAmount"/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
<xs:simpleType name="TaxRecordPeriod1Code">
|
||||||
|
<xs:restriction base="xs:string">
|
||||||
|
<xs:enumeration value="MM01"/>
|
||||||
|
<xs:enumeration value="MM02"/>
|
||||||
|
<xs:enumeration value="MM03"/>
|
||||||
|
<xs:enumeration value="MM04"/>
|
||||||
|
<xs:enumeration value="MM05"/>
|
||||||
|
<xs:enumeration value="MM06"/>
|
||||||
|
<xs:enumeration value="MM07"/>
|
||||||
|
<xs:enumeration value="MM08"/>
|
||||||
|
<xs:enumeration value="MM09"/>
|
||||||
|
<xs:enumeration value="MM10"/>
|
||||||
|
<xs:enumeration value="MM11"/>
|
||||||
|
<xs:enumeration value="MM12"/>
|
||||||
|
<xs:enumeration value="QTR1"/>
|
||||||
|
<xs:enumeration value="QTR2"/>
|
||||||
|
<xs:enumeration value="QTR3"/>
|
||||||
|
<xs:enumeration value="QTR4"/>
|
||||||
|
<xs:enumeration value="HLF1"/>
|
||||||
|
<xs:enumeration value="HLF2"/>
|
||||||
|
</xs:restriction>
|
||||||
|
</xs:simpleType>
|
||||||
|
<xs:simpleType name="TrueFalseIndicator">
|
||||||
|
<xs:restriction base="xs:boolean"/>
|
||||||
|
</xs:simpleType>
|
||||||
|
</xs:schema>
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,10 @@
|
|||||||
|
-- deletes for HelperTests.BillingTest
|
||||||
|
|
||||||
|
DELETE FROM credit;
|
||||||
|
DELETE FROM payment_variant
|
||||||
|
DELETE FROM delivery;
|
||||||
|
DELETE FROM area_commitment;
|
||||||
|
DELETE FROM area_commitment_type;
|
||||||
|
DELETE FROM season;
|
||||||
|
DELETE FROM wine_attribute;
|
||||||
|
DELETE FROM wine_cultivation;
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
-- inserts for HelperTests.BillingTest
|
||||||
|
|
||||||
|
INSERT INTO wine_cultivation (cultid, name, description) VALUES
|
||||||
|
('N', 'Normal', NULL),
|
||||||
|
('K', 'KIP', 'Kontrollierte Integrierte Produktion'),
|
||||||
|
('B', 'Org. Biologisch', 'Organisch Biologisch');
|
||||||
|
|
||||||
|
INSERT INTO wine_attribute (attrid, name, active, max_kg_per_ha, strict, fill_lower) VALUES
|
||||||
|
('B', 'Bio', TRUE, NULL, FALSE, 0),
|
||||||
|
('K', 'Kabinett', TRUE, NULL, FALSE, 0),
|
||||||
|
('D', 'DAC', TRUE, 7500, FALSE, 0),
|
||||||
|
('S', 'Saft', TRUE, NULL, FALSE, 0),
|
||||||
|
('Z', 'Sekt', TRUE, NULL, FALSE, 0),
|
||||||
|
('P', 'Vertrag P', TRUE, NULL, TRUE, 0),
|
||||||
|
('Q', 'Vertrag Q', TRUE, NULL, TRUE, 1),
|
||||||
|
('R', 'Vertrag R', TRUE, NULL, TRUE, 2);
|
||||||
|
|
||||||
|
INSERT INTO area_commitment_type (vtrgid, sortid, attrid, disc, min_kg_per_ha, penalty_per_kg, penalty_amount, penalty_none) VALUES
|
||||||
|
('ZW', 'ZW', NULL, NULL, 2500, 600, NULL, NULL),
|
||||||
|
('GV', 'GV', NULL, NULL, 5000, 500, NULL, NULL),
|
||||||
|
('GVK', 'GV', 'K', NULL, 5000, 500, NULL, NULL),
|
||||||
|
('GVD', 'GV', 'D', NULL, 5000, 1000, NULL, NULL),
|
||||||
|
('GVP', 'GV', 'P', NULL, 5000, 1000, 1000000, NULL),
|
||||||
|
('GVQ', 'GV', 'Q', NULL, 5000, 1000, 1000000, NULL),
|
||||||
|
('GVR', 'GV', 'R', NULL, 5000, 1000, 1000000, NULL);
|
||||||
|
|
||||||
|
INSERT INTO area_commitment (fbnr, mgnr, vtrgid, cultid, area, kgnr, gstnr, rdnr, year_from, year_to) VALUES
|
||||||
|
( 1, 101, 'GV', 'K', 10000, 06109, '123/4', NULL, 2000, 2019),
|
||||||
|
( 2, 101, 'GV', 'K', 10000, 06109, '123/5', NULL, 2025, 2030),
|
||||||
|
( 3, 101, 'GV', 'K', 10000, 06109, '123/6', NULL, 2021, 2031);
|
||||||
|
|
||||||
|
INSERT INTO season (year, currency, min_kg_per_bs, max_kg_per_bs, penalty_per_kg, penalty_amount, penalty_none, start_date, end_date) VALUES
|
||||||
|
(2020, 'EUR', 1000, 2000, NULL, NULL, NULL, NULL, NULL),
|
||||||
|
(2021, 'EUR', 2000, 4000, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
INSERT INTO modifier (year, modid, ordering, name, abs, rel, standard, quick_select) VALUES
|
||||||
|
(2020, 'S', 0, 'Geschädigte Trauben', NULL, -0.1, FALSE, FALSE),
|
||||||
|
(2020, 'A', 0, 'Keine Voranmeldung', -1000, NULL, FALSE, FALSE);
|
||||||
|
|
||||||
|
-- Test 01
|
||||||
|
INSERT INTO delivery (mgnr, year, did, date, time, zwstid, lnr) VALUES
|
||||||
|
(101, 2020, 1, '2020-10-01', NULL, 'X', 1),
|
||||||
|
(101, 2020, 2, '2020-10-01', NULL, 'X', 2),
|
||||||
|
(101, 2020, 3, '2020-10-01', NULL, 'X', 3);
|
||||||
|
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, weight, kmw, qualid, hkid, kgnr, gerebelt, manual_weighing, spl_check, scale_id, weighing_id, weighing_reason) VALUES
|
||||||
|
(2020, 1, 1, 'GV', 'K', 4000, 17, 'KAB', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2020, 1, 2, 'GV', NULL, 4000, 16, 'QUW', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2020, 2, 1, 'GV', 'B', 4000, 15, 'QUW', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2020, 2, 2, 'GV', 'B', 4000, 16, 'QUW', 'WLNO', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2020, 3, 1, 'GV', NULL, 500, 15, 'WEI', 'OEST', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2020, 3, 2, 'GV', NULL, 500, 14, 'LDW', 'WLXX', 06109, TRUE, FALSE, FALSE, NULL, NULL, NULL);
|
||||||
|
INSERT INTO delivery_part_modifier (year, did, dpnr, modid) VALUES
|
||||||
|
(2020, 1, 2, 'S');
|
||||||
|
|
||||||
|
-- Test 02 + 03
|
||||||
|
INSERT INTO delivery (mgnr, year, did, date, time, zwstid, lnr) VALUES
|
||||||
|
(101, 2021, 1, '2021-10-01', NULL, 'X', 1),
|
||||||
|
(101, 2021, 2, '2021-10-01', NULL, 'X', 2),
|
||||||
|
(101, 2021, 3, '2021-10-01', NULL, 'X', 3);
|
||||||
|
INSERT INTO delivery_part (year, did, dpnr, sortid, attrid, weight, kmw, qualid, hkid, kgnr, gebunden, gerebelt, manual_weighing, spl_check, scale_id, weighing_id, weighing_reason) VALUES
|
||||||
|
(2021, 1, 1, 'GV', 'K', 4000, 17, 'KAB', 'WLNO', 06109, TRUE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2021, 1, 2, 'GV', NULL, 4000, 16, 'QUW', 'WLNO', 06109, FALSE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2021, 2, 1, 'GV', 'B', 4000, 15, 'QUW', 'WLNO', 06109, TRUE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2021, 2, 2, 'GV', 'B', 4000, 16, 'QUW', 'WLNO', 06109, FALSE, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2021, 3, 1, 'GV', NULL, 500, 15, 'WEI', 'OEST', 06109, NULL, TRUE, FALSE, FALSE, NULL, NULL, NULL),
|
||||||
|
(2021, 3, 2, 'GV', NULL, 500, 14, 'LDW', 'WLXX', 06109, NULL, TRUE, FALSE, FALSE, NULL, NULL, NULL);
|
||||||
@@ -1,5 +1,16 @@
|
|||||||
-- inserts for DatabaseSetup
|
-- inserts for DatabaseSetup
|
||||||
|
|
||||||
|
INSERT INTO client_parameter (param, value) VALUES
|
||||||
|
('CLIENT_NAME_TOKEN', 'WGT'),
|
||||||
|
('CLIENT_NAME_SHORT', 'WG Test'),
|
||||||
|
('CLIENT_NAME', 'Winzergenossenschaft Test'),
|
||||||
|
('CLIENT_NAME_SUFFIX', NULL),
|
||||||
|
('CLIENT_NAME_TYPE', 'reg.Gen.m.b.H.'),
|
||||||
|
('CLIENT_PLZ', '1234'),
|
||||||
|
('CLIENT_ORT', 'Musterstadt'),
|
||||||
|
('CLIENT_ADDRESS', 'Musterstraße 1'),
|
||||||
|
('CLIENT_IBAN', 'AT12 3456 7890 1234 5678');
|
||||||
|
|
||||||
INSERT INTO branch (zwstid, name) VALUES
|
INSERT INTO branch (zwstid, name) VALUES
|
||||||
('X', 'Test');
|
('X', 'Test');
|
||||||
|
|
||||||
@@ -51,3 +62,9 @@ INSERT INTO AT_plz_dest (plz, okz, dest) VALUES
|
|||||||
(2122, 05135, 'Münichsthal'),
|
(2122, 05135, 'Münichsthal'),
|
||||||
(2122, 05136, 'Pfösing'),
|
(2122, 05136, 'Pfösing'),
|
||||||
(2122, 05137, 'Riedenthal');
|
(2122, 05137, 'Riedenthal');
|
||||||
|
|
||||||
|
INSERT INTO member (mgnr, given_name, family_name, zwstid, volllieferant, buchführend, country, postal_dest, address, default_kgnr, iban) VALUES
|
||||||
|
(101, 'Max', 'Mustermann', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 1', 06109, 'AT123456789012345678'),
|
||||||
|
(102, 'Wernhardt', 'Weinbauer', 'X', FALSE, FALSE, 40, 222303524, 'Winzerstraße 2', 06109, 'AT123456789012345678'),
|
||||||
|
(103, 'Matthäus', 'Musterbauer', 'X', FALSE, FALSE, 40, 212005138, 'Brünner Straße 10', 15224, 'AT123456789012345678'),
|
||||||
|
(104, 'Waltraud', 'Winzer', 'X', FALSE, FALSE, 40, 212005138, 'Wiener Straße 15', 15224, 'AT123456789012345678');
|
||||||
+3
-2
@@ -10,10 +10,11 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Resources\*.sql" />
|
<EmbeddedResource Include="Resources\Sql\*.sql" />
|
||||||
|
<EmbeddedResource Include="Resources\Schemas\*.xsd" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
|
<Target Name="FetchResources" BeforeTargets="BeforeBuild">
|
||||||
<Exec Command="call fetch-resources.bat" />
|
<Exec Command="call fetch-resources.bat" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
curl -s "https://www.necronda.net/elwig/files/create.sql?v=13" -u "elwig:ganzGeheim123!" -o "Resources\Create.sql"
|
curl -s -L "https://www.necronda.net/elwig/files/create.sql?v=15" -u "elwig:ganzGeheim123!" -o "Resources\Sql\Create.sql"
|
||||||
|
|||||||
Reference in New Issue
Block a user