|
|
using Gremlin_BlazorServer.Data.DBClasses;
|
|
|
using Gremlin_BlazorServer.Data.EntityClasses;
|
|
|
using Microsoft.JSInterop;
|
|
|
using System.Text;
|
|
|
using static Gremlin_BlazorServer.Data.EntityClasses.Enums;
|
|
|
|
|
|
namespace Gremlin_BlazorServer.Services
|
|
|
{
|
|
|
public class TexService
|
|
|
{
|
|
|
private static GremlinContext gremlinContext = new();
|
|
|
public TexService(GremlinContext gC) => gremlinContext = gC;
|
|
|
|
|
|
private readonly AccountService accountService = new(gremlinContext);
|
|
|
private readonly CustomDescriptionService customDescriptionService = new(gremlinContext);
|
|
|
|
|
|
public async Task<StringBuilder> CreateTexAsync(Quote quote)
|
|
|
{
|
|
|
StringBuilder texStringBuilder = await CreateTexFileAsync(quote);
|
|
|
string correctedTex = Replace(texStringBuilder.ToString());
|
|
|
return new StringBuilder(correctedTex);
|
|
|
}
|
|
|
|
|
|
public async Task<StringBuilder> CreateBriefkopfAsync(Contact contact, bool tex = false)
|
|
|
{
|
|
|
StringBuilder briefkopf = new();
|
|
|
|
|
|
_ = contact.Gender == (byte)Enums.Gender.Male
|
|
|
? briefkopf.AppendLine($"Herr {contact.FirstName} {contact.LastName}")
|
|
|
: briefkopf.AppendLine($"Frau {contact.FirstName} {contact.LastName}");
|
|
|
if (tex)
|
|
|
{
|
|
|
_ = briefkopf.AppendLine($"\\\\");
|
|
|
}
|
|
|
|
|
|
Account account = await accountService.GetAccountAsync(contact.AccountId);
|
|
|
|
|
|
//AccountNamen mit "&" im Namen abfangen
|
|
|
_ = account.AccountName.Replace("&", "\\&");
|
|
|
|
|
|
//if (tex && account.AccountName.Contains('&'))
|
|
|
//{
|
|
|
// string[] accountNameSplit = account.AccountName.Split("&");
|
|
|
// account.AccountName = "";
|
|
|
// for (int i = 0; i < accountNameSplit.Length; i++)
|
|
|
// {
|
|
|
// account.AccountName += i < accountNameSplit.Length - 1
|
|
|
// ? accountNameSplit[i] + "\\&"
|
|
|
// : accountNameSplit[i];
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
_ = briefkopf.AppendLine($"{account.AccountName}");
|
|
|
if (tex) { _ = briefkopf.AppendLine($"\\\\"); }
|
|
|
|
|
|
_ = briefkopf.AppendLine($"{account.Street}");
|
|
|
if (tex) { _ = briefkopf.AppendLine($"\\\\"); }
|
|
|
|
|
|
_ = briefkopf.AppendLine($"{account.ZIP} {account.City}");
|
|
|
if (tex) { _ = briefkopf.AppendLine($"\\\\"); }
|
|
|
|
|
|
return briefkopf;
|
|
|
}
|
|
|
|
|
|
private async Task<StringBuilder> CreateTexFileAsync(Quote quote)
|
|
|
{
|
|
|
string rand = "2"; //RUSettingModel.GetSettingValue(Properties.Settings.Default.userSettingID, "texRand");
|
|
|
|
|
|
StringBuilder texFile = new($"\\documentclass[a4paper,ngerman,parskip,10pt]{{scrlttr2}}\n"
|
|
|
+ $"\\usepackage{{lmodern}}\n"
|
|
|
+ $"\\usepackage[T1]{{fontenc}}\n"
|
|
|
+ $"\\usepackage[utf8]{{inputenc}}\n"
|
|
|
+ $"\\usepackage{{babel}}\n"
|
|
|
+ $"\\usepackage[hidelinks]{{hyperref}}\n");
|
|
|
|
|
|
_ = texFile.AppendLine($"\\usepackage[left={rand}cm, right={rand}cm, top={rand}cm, bottom={rand}cm]{{geometry}}\n");
|
|
|
_ = texFile.AppendLine($"\\usepackage[table]{{xcolor}}\n"
|
|
|
+ "\\usepackage[right]{{eurosym}}\n"
|
|
|
+ "\\usepackage[locale=DE]{{siunitx}}\n"
|
|
|
+ "\\usepackage{{scrlayer-scrpage}}\n"
|
|
|
+ "\\usepackage{{lastpage}}\n"
|
|
|
+ "\\usepackage{{graphicx}}\n"
|
|
|
+ "\\usepackage{{multirow}}\n"
|
|
|
+ "\\usepackage{{longtable}}\n"
|
|
|
+ "\\usepackage{{enumitem}}\n"
|
|
|
+ "\\usepackage{{fp, xstring, spreadtab, numprint}}\n"
|
|
|
+ "\\DeclareSIUnit{{\\sieuro}}{{\\mbox{{\\euro}}}}");
|
|
|
|
|
|
_ = texFile.AppendLine($"\\rohead{{{quote.QuotationNumber}}}");
|
|
|
_ = texFile.AppendLine("\\cfoot{Seite \\thepage/\\pageref{LastPage}}\n"
|
|
|
+ "\\sisetup{round-integer-to-decimal,round-precision=2,round-mode=places}"
|
|
|
+ "\n\\newcommand{\\produkttitel}[1]{\\textsc{#1}}"
|
|
|
+ "\n\\renewcommand{\\arraystretch}{1.2}\n\\definecolor{AgilentBlau}{HTML}{0085d5}"
|
|
|
+ "\n\\setlist{noitemsep}\n\\begin{document}"
|
|
|
+ "\n\\begin{tabular}{p{0.4\\hsize}p{0.5\\hsize}}"
|
|
|
+ "\n\\multirow{4}{*}{\\includegraphics[width=0.9\\hsize]{agilentLogo.png}}"
|
|
|
+ "\n&\\normalsize{Agilent Technologies Deutschland GmbH}\\\\"
|
|
|
+ "\n&\\normalsize{Life Sciences \\& Chemical Analysis}\\\\"
|
|
|
+ $"\n&\\normalsize{{Hewlett-Packard-Str. 8}}\\\\"
|
|
|
+ "\n&\\normalsize{D-76337 Waldbronn}"
|
|
|
+ "\n\\end{tabular}"
|
|
|
+ "\n\\par\n\\begin{flushright}");
|
|
|
|
|
|
_ = quote.IsPriceInformation
|
|
|
? texFile.AppendLine("\n\\colorbox{AgilentBlau}{\\textcolor{white}{\\textsc{\\Huge{Preisinformation}}}}\n\\end{flushright}\n\\begin{tabular}{p{0.4\\hsize}p{0.6\\hsize}}")
|
|
|
: texFile.AppendLine("\n\\colorbox{AgilentBlau}{\\textcolor{white}{\\textsc{\\Huge{Angebot}}}}\n\\end{flushright}\n\\begin{tabular}{p{0.4\\hsize}p{0.6\\hsize}}");
|
|
|
|
|
|
_ = texFile.AppendLine("\n &\n\\multirow{4}{*}{"
|
|
|
+ "\n\\begin{tabular}{|ll|}"
|
|
|
+ "\n\\hline");
|
|
|
|
|
|
_ = texFile.AppendLine($"\\textbf{{Angebotsnummer:}}&{quote.QuotationNumber}\\\\");
|
|
|
_ = texFile.Append($"Angebotdatum:&\\today\\\\\nAngebotsgültigkeit:&{quote.ValidFor} Tage\\\\");
|
|
|
_ = texFile.AppendLine($"\\textbf{{Ansprechpartner:}}&{quote.SalesRep.FirstName} {quote.SalesRep.LastName}\\\\");
|
|
|
_ = texFile.AppendLine($"Telefon: &{quote.SalesRep.PhoneNumber}\\\\");
|
|
|
_ = texFile.AppendLine($"Mobil:&{quote.SalesRep.MobileNumber}\\\\");
|
|
|
_ = texFile.AppendLine($"E-Mail:&\\href{{mailto:{quote.SalesRep.EMail}}}{{{quote.SalesRep.EMail}}}\\\\");
|
|
|
_ = texFile.AppendLine("\\textbf{Auftragsannahme:}&\\href{mailto:salesservices\\_germany@agilent.com}{salesservices\\_germany@agilent.com}\\\\\n\\hline\n\\end{tabular}\n}\\\\");
|
|
|
|
|
|
if (quote.Recipient != null)
|
|
|
{
|
|
|
_ = texFile.Append(await CreateBriefkopfAsync(quote.Recipient, true));
|
|
|
}
|
|
|
|
|
|
_ = texFile.AppendLine("&\\\\\n&\\\\\n\\end{tabular}\n\\vspace{1cm}\\par ");
|
|
|
|
|
|
//Anrede
|
|
|
if (quote.Recipient != null)
|
|
|
{
|
|
|
_ = quote.Recipient.Gender == (byte)Gender.Male
|
|
|
? texFile.AppendLine($"Sehr geehrter Herr {quote.Recipient.LastName},\\par ")
|
|
|
: texFile.AppendLine($"Sehr geehrte Frau {quote.Recipient.LastName},\\par ");
|
|
|
}
|
|
|
|
|
|
//Anschreiben
|
|
|
_ = texFile.AppendLine(await CreateCoverletterAsync(quote));
|
|
|
|
|
|
//RB-Disclaimer
|
|
|
if (quote.QuoteContainsRB)
|
|
|
{
|
|
|
_ = texFile.AppendLine(await CreateRBDisclaimerAsync(quote));
|
|
|
}
|
|
|
|
|
|
//Tabelle
|
|
|
_ = texFile.AppendLine("\\begin{center}");
|
|
|
_ = texFile.AppendLine("\\begin{longtable}");
|
|
|
|
|
|
if (quote.ShowSinglePrices)
|
|
|
{
|
|
|
if (!quote.ShowDiscounts)
|
|
|
{
|
|
|
//mit Einzelpreisen
|
|
|
_ = texFile.AppendLine("{| cp{0.71\\textwidth} cr |} \\hline");
|
|
|
_ = texFile.AppendLine(@"\textbf{\#} & \textbf{Produktbeschreibung} (Produktnummer) & \textbf{Menge} & \textbf{Preis}\\ \hline \endhead");
|
|
|
}
|
|
|
else if (quote.ShowDiscounts)
|
|
|
{
|
|
|
//mit Einzelpreisen und Discounts
|
|
|
_ = texFile.AppendLine("{| cp{0.595\\textwidth} crr |} \\hline");
|
|
|
_ = texFile.AppendLine(@"\textbf{\#} & \textbf{Produktbeschreibung} (Produktnummer) & \textbf{Menge} & \textbf{Discount} & \textbf{Preis}\\ \hline \endhead");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//ohne Einzelpreise
|
|
|
_ = texFile.AppendLine("{| cp{0.83\\textwidth} c |} \\hline");
|
|
|
_ = texFile.AppendLine(@"\textbf{\#} & \textbf{Produktbeschreibung} (Produktnummer) & \textbf{Menge}\\ \hline \endhead");
|
|
|
}
|
|
|
|
|
|
foreach (LineItem lI in quote.LineItems)
|
|
|
{
|
|
|
string lineItemTex = "";
|
|
|
CustomDescription cD = await customDescriptionService.GetCustomDescriptionAsync(lI.ProductNumber, lI.OptionNumber);
|
|
|
|
|
|
if (quote.ShowSinglePrices == true)
|
|
|
{
|
|
|
if (!quote.ShowDiscounts)
|
|
|
{
|
|
|
//mit Einzelpreisen
|
|
|
lineItemTex = lI.OptionNumber != ""
|
|
|
? $"{lI.Position} &\\textbf{{{cD.Heading}}} ({lI.ProductNumber}\\#{lI.OptionNumber})\\newline {cD.DescriptionText}&{lI.Amount}&\\SI{{{lI.Total}}}{{\\sieuro}}\\\\"
|
|
|
: $"{lI.Position} &\\textbf{{{cD.Heading}}} ({lI.ProductNumber})\\newline {cD.DescriptionText}&{lI.Amount}&\\SI{{{lI.Total}}}{{\\sieuro}}\\\\";
|
|
|
}
|
|
|
else if (quote.ShowDiscounts)
|
|
|
{
|
|
|
//mit Einzelpreisen und Discounts
|
|
|
lineItemTex = lI.OptionNumber != ""
|
|
|
? $"{lI.Position} &\\textbf{{{cD.Heading}}} ({lI.ProductNumber}\\#{lI.OptionNumber})\\newline {cD.DescriptionText}\\newline Listenpreis: \\SI{{{lI.ListPrice}}}{{\\sieuro}}&{lI.Amount}&\\SI{{{lI.TotalDiscount}}}{{\\%}}&\\SI{{{lI.Total}}}{{\\sieuro}}\\\\"
|
|
|
: $"{lI.Position} &\\textbf{{{cD.Heading}}} ({lI.ProductNumber})\\newline {cD.DescriptionText}\\newline Listenpreis: \\SI{{{lI.ListPrice}}}{{\\sieuro}}&{lI.Amount}&\\SI{{{lI.TotalDiscount}}}{{\\%}}&\\SI{{{lI.Total}}}{{\\sieuro}}\\\\";
|
|
|
}
|
|
|
}
|
|
|
else if (!quote.ShowSinglePrices)
|
|
|
{
|
|
|
//ohne Einzelpreise
|
|
|
lineItemTex = lI.OptionNumber != ""
|
|
|
? $"{lI.Position} &\\textbf{{{cD.Heading}}} ({lI.ProductNumber}\\#{lI.OptionNumber})\\newline {cD.DescriptionText}&{lI.Amount}\\\\"
|
|
|
: $"{lI.Position} &\\textbf{{{cD.Heading}}} ({lI.ProductNumber})\\newline {cD.DescriptionText}&{lI.Amount}\\\\";
|
|
|
}
|
|
|
|
|
|
_ = texFile.Append(lineItemTex + "\n");
|
|
|
}
|
|
|
|
|
|
_ = texFile.AppendLine("\\hline\n"
|
|
|
+ "\\end{longtable}\n"
|
|
|
+ "\\end{center}\n");
|
|
|
|
|
|
_ = texFile.AppendLine("\\vspace{-2cm}\n"
|
|
|
+ "\\begin{flushright}\n\n"
|
|
|
+ "\\begin{tabular}{|rr|}\n"
|
|
|
+ "\\hline");
|
|
|
|
|
|
//Summe netto
|
|
|
_ = texFile.AppendLine($"\\textbf{{Summe netto}} & \\SI{{{quote.TotalNet}}}{{\\sieuro}}\\\\");
|
|
|
|
|
|
//Frachtkosten
|
|
|
_ = texFile.AppendLine($"\\textbf{{Versand und Bereitstellungskosten ({quote.Freight}\\%)}} & \\SI{{{quote.TotalFreightOnly}}}{{\\sieuro}}\\\\");
|
|
|
|
|
|
//Gesamtsumme netto
|
|
|
_ = texFile.AppendLine($"\\textbf{{Gesamtsumme netto}} & \\SI{{{quote.TotalFreight}}}{{\\sieuro}}\\\\");
|
|
|
|
|
|
//mit Mehrwertsteuer
|
|
|
if (quote.ShowBrutto == true)
|
|
|
{
|
|
|
_ = texFile.AppendLine($"\\textbf{{Umsatzsteuer ({quote.VAT}\\%)}} & \\SI{{{quote.TotalVAT}}}{{\\sieuro}}\\\\");
|
|
|
_ = texFile.AppendLine($"\\textbf{{Gesamtsumme brutto}} & \\SI{{{quote.TotalGross}}}{{\\sieuro}}\\\\");
|
|
|
}
|
|
|
|
|
|
_ = texFile.Append("\\hline\n\\end{tabular}\n\n\\end{flushright}\n\nDer Betrag versteht sich zzgl. der gesetzlichen Steuern.\\\\\nDiese werden im Rechnungszeitraum auf der Rechnung gesondert ausgewiesen.\\\\\nZahlungsbedingungen: 30 Tage netto ab Rechnungsdatum.\\\\\nIncoterm (2010) für Lieferungen innerhalb Deutschlands: DDP.\n\\begin{small}\n\n");
|
|
|
_ = texFile.AppendLine($"\\textbf{{Gewährleistung:}}\\\\\nDie Gewährleistung für Zubehör und Ersatzteilprodukte und für Analytik-Hardwareprodukte beträgt {quote.Warranty} Monate.\n");
|
|
|
|
|
|
//3PP-Disclaimer
|
|
|
if (quote.QuoteContains3PP)
|
|
|
{
|
|
|
_ = texFile.AppendLine(Create3PPDisclaimer(quote));
|
|
|
}
|
|
|
|
|
|
_ = texFile.AppendLine($"\\textbf{{Hinweis:}}\\\\ \n" +
|
|
|
$"Für den Verkauf der in diesem Angebot aufgeführten Standard-Produkte und -Services gelten die aktuellen \\emph{{Agilent Geschäftsbedingungen}} und alle sonstigen anwendbaren Zusatzbedingungen sowie zusätzliche Bedingungen, soweit darauf hier Bezug genommen wird. Soweit Produkte oder Services nach speziellen Kundenanforderungen hergestellt, konfiguriert oder angepasst werden, gelten für den Verkauf aller in diesem Angebot aufgeführten Produkte und Services die aktuellen \\emph{{Agilent Geschäftsbedingungen für kundenspezifische Produkte}} und alle sonstigen anwendbaren Zusatzbedingungen sowie zusätzliche Bedingungen, soweit darauf hier Bezug genommen wird. Eine Kopie der maßgeblichen Bedingungen ist entweder beigefügt oder wurde Ihnen bereits zur Verfügung gestellt. Sollten Sie keine Kopie erhalten haben oder eine weitere Kopie benötigen, setzen Sie sich bitte mit uns in Verbindung. Soweit Sie mit Agilent eine gesonderte Vereinbarung getroffen haben, die den Verkauf der in diesem Angebot aufgeführten Produkte und Services umfasst, sind die Bestimmungen dieser Vereinbarung anwendbar. Abweichende oder ergänzende Vereinbarungen, insbesondere widersprechende Geschäftsbedingungen, sind nur gültig, wenn sie ausdrücklich schriftlich vereinbart worden sind. Die angegebenen Daten zur Verfügbarkeit von Produkten und Services sind vorläufig. Die tatsächlichen Lieferzeiten bzw. Lieferperioden werden Ihnen bei Auftragsbestätigung mitgeteilt. Waren, Technologien oder Software, die aus den Vereinigten Staaten von Amerika (\\emph{{USA}}) oder anderen exportierenden Ländern ausgeführt werden, unterliegen den Ausfuhrbestimmungen der USA sowie anderer Rechtsordnungen. Bei Ausfuhr ist der Kunde dafür verantwortlich, dass die anwendbaren Ausfuhrbestimmungen eingehalten werden.\n" +
|
|
|
$"\\end{{small}}\n \n" +
|
|
|
$"\\begin{{scriptsize}}\n" +
|
|
|
$"Agilent Technologies Deutschland GmbH, Hewlett-Packard-Str. 8, D-76337 Waldbronn\\\\\nTelefon +49 (0)7243-602-0\\\\\nUSt.-IdNr.: DE812729296, WEEE-Reg.-Nr. DE 86631749\\\\\nSitz der Gesellschaft: Waldbronn – Amtsgericht Mannheim, HRB 723782\\\\\nGeschäftsführer: Dr. Andreas Kistner (Vorsitzender der Geschäftsführung), Armin Jehle, Norbert Sabatzki, Dr. Knut Wintergerst\\\\\n" +
|
|
|
$"\\href{{www.agilent.com}}{{www.agilent.com}}\n\\end{{scriptsize}}\n\\end{{document}}");
|
|
|
|
|
|
return texFile;
|
|
|
}
|
|
|
|
|
|
private async Task<string> CreateRBDisclaimerAsync(Quote quote)
|
|
|
{
|
|
|
Random r = new();
|
|
|
|
|
|
string rbDisclaimer = "\\textbf{Wichtiger Hinweis zur Bestellung von überholten Geräten}\\\\\n";
|
|
|
rbDisclaimer += "Bitte beachten Sie, dass in der Regel nur wenige gebrauchte Geräte auf Lager sind und diese ohne die Möglichkeit einer Reservierung auf „first come, first serve“-Basis verkauft werden. Um lange Lieferzeiten zu vermeiden, sollte daher bei konkretem Interesse zunächst der Lagerstand überprüft werden. Die aktuellen Lagerbestände sind:\n";
|
|
|
|
|
|
List<LineItem> lineItemsWithRB = quote.LineItems.Where(lI => lI.ProductLine == "RB").ToList();
|
|
|
rbDisclaimer += "\\begin{center}\n\\begin{tabular}{clc}\n";
|
|
|
rbDisclaimer += "\\textbf{Modul} & \\textbf{Beschreibung} &\\textbf{Bestand}\\\\ \\hline \n";
|
|
|
|
|
|
foreach (LineItem lineItemWithRB in lineItemsWithRB)
|
|
|
{
|
|
|
CustomDescription customDescription = await customDescriptionService.GetCustomDescriptionAsync(lineItemWithRB.ProductNumber, lineItemWithRB.OptionNumber);
|
|
|
int rbcount = r.Next(20) - 5; //Get count of RB?
|
|
|
rbDisclaimer += $"{lineItemWithRB.ProductNumber} & {customDescription.Heading} & {rbcount}\\\\ \n";
|
|
|
}
|
|
|
rbDisclaimer += "\\end{tabular}\n\\end{center}\n";
|
|
|
|
|
|
return rbDisclaimer;
|
|
|
}
|
|
|
|
|
|
private static string Create3PPDisclaimer(Quote quote)
|
|
|
{
|
|
|
string dreipp = "\\textbf{Hinweis zu Non-Agilent-Produkten}\\\\ \n"
|
|
|
+ $"Bitte beachten Sie, dass das/die o.g. Produkt/e ";
|
|
|
|
|
|
//List all 3PP product numbers
|
|
|
List<LineItem> lineItemsWith3PP = quote.LineItems.Where(lI => lI.ProductLine == "3PP").ToList();
|
|
|
for (int i = 0; i < lineItemsWith3PP.Count; i++)
|
|
|
{
|
|
|
_ = i < lineItemsWith3PP.Count - 1
|
|
|
? dreipp += $"{lineItemsWith3PP[i].ProductNumber}, "
|
|
|
: dreipp += $"{lineItemsWith3PP[i].ProductNumber}";
|
|
|
|
|
|
//Get all 3PP Supplier
|
|
|
//List<Supllier> supllier3PP = lineItemWith3PP.ProductLine.Supplier;
|
|
|
}
|
|
|
|
|
|
dreipp += " nicht von Agilent Technologies hergestellt wird/werden. Agilent Technologies lehnt daher jede Art der Haftung für Leistung, Qualität, Zuverlässigkeitund Lieferung für dieses/r Produkt/e ab.\\\\\n"
|
|
|
+ $"Die Standardgewährleistung, einschließlich Schadensersatz für die Rechtsverletzung von intellektuellem Eigentum, liegt beim Hersteller bzw. Lieferanten des/r Produkt/e, solange nichts anders im Angebot von Agilent Technologies spezifiziert wird.\n";
|
|
|
|
|
|
//dreipp += "\\textbf{Hersteller:}";
|
|
|
//supllier3PP
|
|
|
|
|
|
return dreipp;
|
|
|
}
|
|
|
|
|
|
private async Task<string> GetCoverletterRowAsync(LineItem lineItem)
|
|
|
{
|
|
|
CustomDescription customDescription = await customDescriptionService.GetCustomDescriptionAsync(lineItem.ProductNumber, lineItem.OptionNumber);
|
|
|
return customDescription.CoverletterText == ""
|
|
|
? $"\\item {customDescription.Heading} (\\#{lineItem.Position})\n"
|
|
|
: $"\\item {customDescription.CoverletterText} (\\#{lineItem.Position})\n";
|
|
|
}
|
|
|
|
|
|
private async Task<string> CreateCoverletterAsync(Quote quote)
|
|
|
{
|
|
|
bool subitem = false;
|
|
|
|
|
|
string coverLetter = $"nachfolgend erhalten Sie Ihr gewünschtes Angebot über ein(e) {quote.Description}.\\\\\n"
|
|
|
+ "Es umfasst im Einzelnen:\n"
|
|
|
+ "\\begin{itemize}\n";
|
|
|
|
|
|
foreach (LineItem lineItem in quote.LineItems)
|
|
|
{
|
|
|
if (lineItem.OptionNumber == "")
|
|
|
{
|
|
|
//Hauptitem
|
|
|
if (subitem)
|
|
|
{
|
|
|
//vorheriges Subitem schließen
|
|
|
coverLetter += "\\end{itemize}\n";
|
|
|
subitem = false;
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
if (!subitem)
|
|
|
{
|
|
|
//neues Subitem
|
|
|
subitem = true;
|
|
|
coverLetter += "\\begin{itemize}\n";
|
|
|
}
|
|
|
}
|
|
|
coverLetter += await GetCoverletterRowAsync(lineItem);
|
|
|
}
|
|
|
|
|
|
if (subitem)
|
|
|
{
|
|
|
//wenn das letzte Item ein Subitem war
|
|
|
coverLetter += "\\end{itemize}\n";
|
|
|
}
|
|
|
|
|
|
coverLetter += $"\\end{{itemize}}\n"
|
|
|
+ "Für Rückfragen und Änderungswünsche stehe ich Ihnen gerne zur Verfügung.\\par\n"
|
|
|
+ "Mit freundlichen Grüßen\\\\\n"
|
|
|
+ "\\includegraphics[width = 5cm]{signWoitschetzki.png}\n"
|
|
|
+ "\\vspace{1cm} \\\\ \n";
|
|
|
|
|
|
return coverLetter;
|
|
|
}
|
|
|
|
|
|
public static string Replace(string text)
|
|
|
{
|
|
|
if (text == "")
|
|
|
{
|
|
|
return "";
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
//text = text.Contains(" & ") ? text.Replace(" & ", " \\& ") : text;
|
|
|
text = text.Contains("<Shift-Enter>") ? text.Replace("<Shift-Enter>", "\\newline ") : text;
|
|
|
return text;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
} |