added freight

pull/1/head
DJh2o2 2022-02-10 09:43:45 +07:00
parent 3acfd3b42c
commit 3adbd25d76
4 changed files with 29 additions and 13 deletions

@ -176,14 +176,20 @@ namespace Gremlin.MVVM
+ "\\begin{tabular}{|rr|}\n"
+ "\\hline");
//Gesamtsumme
_ = texFile.AppendLine($"\\textbf{{Gesamtsumme netto}} & \\SI{{{quoteVM.TotalNet}}}{{\\sieuro}}\\\\");
//Summe netto
_ = texFile.AppendLine($"\\textbf{{Summe netto}} & \\SI{{{quoteVM.TotalNet}}}{{\\sieuro}}\\\\");
//Frachtkosten
_ = texFile.AppendLine($"\\textbf{{Frachtkosten ({quoteVM.Freight}\\%)}} & \\SI{{{quoteVM.TotalFreightOnly}}}{{\\sieuro}}\\\\");
//Gesamtsumme netto
_ = texFile.AppendLine($"\\textbf{{Gesamtsumme netto}} & \\SI{{{quoteVM.TotalFreight}}}{{\\sieuro}}\\\\");
//mit Mehrwertsteuer
if (quoteVM.ShowBrutto == true)
{
_ = texFile.AppendLine($"\\textbf{{Mehrwertsteuer {quoteVM.VAT}\\%}} & \\SI{{{(float)quoteVM.TotalNet * quoteVM.VAT / 100}}}{{\\sieuro}}\\\\");
_ = texFile.AppendLine($"\\textbf{{Gesamtsumme brutto}} & \\SI{{{(float)quoteVM.TotalNet * (1 + (quoteVM.VAT / 100))}}}{{\\sieuro}}\\\\");
_ = texFile.AppendLine($"\\textbf{{Mehrwertsteuer ({quoteVM.VAT}\\%)}} & \\SI{{{quoteVM.TotalVAT}}}{{\\sieuro}}\\\\");
_ = texFile.AppendLine($"\\textbf{{Gesamtsumme brutto}} & \\SI{{{quoteVM.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");

@ -43,7 +43,7 @@ namespace Gremlin.MVVM
private void BtnPasteQuote_Click(object sender, RoutedEventArgs e)
{
float vat = 19f;
decimal vat = 19;
int warranty = int.TryParse(tbWarranty.Text, out int defaultWarranty) ? defaultWarranty : 12;
int validity = int.TryParse(tbValidity.Text, out int defaultValidity) ? defaultValidity : 60;

@ -18,7 +18,8 @@ namespace Gremlin.MVVM
private string _quoteNumber;
private int _warranty = 12;
private int _validity = 60;
private float _vAT = 19f;
private decimal _vAT = 19;
private decimal _freight = 1;
private bool? _showBrutto = true;
private bool? _singlePrices = true;
private bool? _attachBrochures;
@ -39,9 +40,10 @@ namespace Gremlin.MVVM
public bool? AttachDataSheets { get => _attachDataSheets; set { _attachDataSheets = value; NotifyOfPropertyChange(() => AttachDataSheets); } }
public bool? UseMailTemplate { get => _useMailTemplate; set { _useMailTemplate = value; NotifyOfPropertyChange(() => UseMailTemplate); } }
public bool? ShowDiscounts { get => _showDiscounts; set { _showDiscounts = value; NotifyOfPropertyChange(() => ShowDiscounts); } }
public float VAT { get => _vAT; set { _vAT = value; NotifyOfPropertyChange(() => VAT); } }
public decimal VAT { get => _vAT; set { _vAT = value; NotifyOfPropertyChange(() => VAT); } }
public int OppID { get => _oppID; set { _oppID = value; NotifyOfPropertyChange(() => OppID); } }
public bool Preisinformation { get => _preisinformation; set { _preisinformation = value; NotifyOfPropertyChange(() => Preisinformation); } }
public decimal Freight { get => _freight; set { _freight = value; NotifyOfPropertyChange(() => Freight); } }
public ObservableCollection<LineItemViewModel> LineItemsViewModel { get => _lineItemsVM; set { _lineItemsVM = value; NotifyOfPropertyChange(() => LineItemsViewModel); } }
public ContactViewModel Recipient { get => _recipient; set { _recipient = value; NotifyOfPropertyChange(() => Recipient); } }
@ -50,6 +52,10 @@ namespace Gremlin.MVVM
public decimal TotalListprice => GetTotal("TotalListprice");
public decimal AverageDiscount => GetTotal("AverageDiscount");
public decimal TotalNet => GetTotal("TotalNet");
public decimal TotalFreightOnly => TotalNet * Freight / 100;
public decimal TotalFreight => TotalNet * (1 + VAT) / 100;
public decimal TotalVAT => TotalFreight * VAT / 100;
public decimal TotalGross => TotalNet * (1 + VAT) / 100;
public bool QuoteContains3PP => DoesContains("3PP");
public bool QuoteContainsRB => DoesContains("RB");
@ -78,7 +84,7 @@ namespace Gremlin.MVVM
OppID = random.Next(111111111, 999999999);
}
private QuoteViewModel(string quoteNumber, string quoteType, ContactViewModel recipient, ContactViewModel salesRep, bool? brutto, float vAT, int warranty, int validity, string quotePath, bool? singlePrices, bool? brochures, bool? dataSheets, bool? mailTemplate, bool? showDiscounts)
private QuoteViewModel(string quoteNumber, string quoteType, ContactViewModel recipient, ContactViewModel salesRep, bool? brutto, decimal vAT, int warranty, int validity, string quotePath, bool? singlePrices, bool? brochures, bool? dataSheets, bool? mailTemplate, bool? showDiscounts)
{
QuoteNumber = quoteNumber;
QuoteType = quoteType;
@ -96,7 +102,7 @@ namespace Gremlin.MVVM
ShowDiscounts = showDiscounts;
}
internal static QuoteViewModel CreateQuote(string quoteNumber, ContactViewModel recipient, ContactViewModel salesRep, float vAT = 19f, string quoteType = "ein Analysegerät", bool? brutto = true, int warranty = 12, bool? singlePrices = true, bool? brochures = true, bool? dataSheets = true, bool? mailTemplate = true, string quotePath = "", int validity = 60, bool? showDiscounts = true)
internal static QuoteViewModel CreateQuote(string quoteNumber, ContactViewModel recipient, ContactViewModel salesRep, decimal vAT = 19, string quoteType = "ein Analysegerät", bool? brutto = true, int warranty = 12, bool? singlePrices = true, bool? brochures = true, bool? dataSheets = true, bool? mailTemplate = true, string quotePath = "", int validity = 60, bool? showDiscounts = true)
{
QuoteViewModel quoteVM = new(quoteNumber, quoteType, recipient, salesRep, brutto, vAT, warranty, validity, quotePath, singlePrices, brochures, dataSheets, mailTemplate, showDiscounts);
quoteVM.LineItemsViewModel = new();

@ -28,8 +28,10 @@
<TextBlock x:Name="lblQuotingPath" Text="Angebotspfad" Margin="10,5,10,5"/>
<TextBlock x:Name="lblGewaehrleistung" Text="Gewährleistung (Monate)" Margin="10,5,10,5"/>
<TextBlock x:Name="lblAngebotsgueltigkeit" Text="Angebotsgültigkeit (Tage)" Margin="10,5,10,5"/>
<TextBlock x:Name="lblOppID" Text="SAP Opp ID" Margin="10,5,10,5"/>
</StackPanel>
<!--<TextBlock x:Name="lblOppID" Text="SAP Opp ID" Margin="10,5,10,5"/>-->
<TextBlock x:Name="lblVAT" Text="MwSt. (%)" Margin="10,5,10,5"/>
<TextBlock x:Name="lblFreight" Text="Frachtkosten (%)" Margin="10,5,10,5"/>
</StackPanel>
</Grid>
<Grid Grid.Row="0" Grid.Column="2" Height="Auto">
<StackPanel>
@ -41,8 +43,10 @@
</StackPanel>
<TextBox x:Name="Warranty" Margin="10,5,10,5"/>
<TextBox x:Name="Validity" Margin="10,5,10,5"/>
<TextBox x:Name="OppID" Margin="10,5,10,5"/>
</StackPanel>
<!--<TextBox x:Name="OppID" Margin="10,5,10,5"/>-->
<TextBox x:Name="VAT" Margin="10,5,10,5"/>
<TextBox x:Name="Freight" Margin="10,5,10,5"/>
</StackPanel>
</Grid>
<Grid Grid.Row="0" Grid.Column="3" Height="Auto">
<StackPanel>