try to show summary of QuoteVM

pull/1/head
Sascha Woitschetzki 2022-03-01 15:09:42 +07:00
parent ee025d8b8a
commit d473a063e5
2 changed files with 52 additions and 15 deletions

@ -10,11 +10,11 @@ namespace Gremlin.MVVM
{
public class QuoteViewModel : PropertyChangedBase
{
private string _quoteType = "ein Analysegerät";
private string _quotePath = AppDomain.CurrentDomain.BaseDirectory;
private ObservableCollection<LineItemViewModel> _lineItemsVM = new();
private ContactViewModel _recipient = new();
private ContactViewModel _salesRep = new();
private string quoteType = "ein Analysegerät";
private string quotePath = AppDomain.CurrentDomain.BaseDirectory;
private ObservableCollection<LineItemViewModel> lineItemsVM = new();
private ContactViewModel recipient = new();
private ContactViewModel salesRep = new();
private string _quoteNumber;
private int _warranty = 12;
private int _validity = 60;
@ -28,9 +28,10 @@ namespace Gremlin.MVVM
private bool? _showDiscounts = true;
private int _oppID;
private bool _preisinformation = false;
private decimal totalListprice;
public string QuoteType { get => _quoteType; set { _quoteType = value; NotifyOfPropertyChange(() => QuoteType); } }
public string QuotePath { get => _quotePath; set { _quotePath = CorrectQuotePath(value); NotifyOfPropertyChange(() => QuotePath); } }
public string QuoteType { get => quoteType; set { quoteType = value; NotifyOfPropertyChange(() => QuoteType); } }
public string QuotePath { get => quotePath; set { quotePath = CorrectQuotePath(value); NotifyOfPropertyChange(() => QuotePath); } }
public bool? ShowBrutto { get => _showBrutto; set { _showBrutto = value; NotifyOfPropertyChange(() => ShowBrutto); } }
public string QuoteNumber { get => _quoteNumber; set { _quoteNumber = value; NotifyOfPropertyChange(() => QuoteNumber); } }
public int Warranty { get => _warranty; set { _warranty = value; NotifyOfPropertyChange(() => Warranty); } }
@ -45,11 +46,12 @@ namespace Gremlin.MVVM
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); } }
public ContactViewModel SalesRep { get => _salesRep; set { _salesRep = value; NotifyOfPropertyChange(() => SalesRep); } }
public ObservableCollection<LineItemViewModel> LineItemsViewModel { get => lineItemsVM; set { lineItemsVM = value; NotifyOfPropertyChange(() => LineItemsViewModel); } }
public ContactViewModel Recipient { get => recipient; set { recipient = value; NotifyOfPropertyChange(() => Recipient); } }
public ContactViewModel SalesRep { get => salesRep; set { salesRep = value; NotifyOfPropertyChange(() => SalesRep); } }
public decimal TotalListprice { get => GetTotal("TotalListprice"); set { totalListprice = value; NotifyOfPropertyChange(() => TotalListprice); } }
public decimal TotalListprice => GetTotal("TotalListprice");
public decimal AverageDiscount => GetTotal("AverageDiscount");
public decimal TotalNet => GetTotal("TotalNet");
public decimal TotalFreightOnly => GetFreight(TotalNet, Freight);

@ -3,10 +3,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="2*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<RowDefinition Height="*"/>
<!--<RowDefinition Height="*"/>-->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
@ -79,5 +79,40 @@
AlternatingRowBackground="LightGray"
/>
</Grid>
</Grid>
<!--TotalTaxFreight-->
<Grid Grid.Row="3" Grid.ColumnSpan="3" Height="Auto">
<StackPanel Orientation="Vertical" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
<TextBlock x:Name="lblTotalNet" Text="Summe netto" Margin="10,5,10,5"/>
<TextBox x:Name="TotalListprice" Margin="10,5,10,5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
<TextBlock x:Name="lblTotalFreightOnly" Text="Frachtkosten" Margin="10,5,10,5"/>
<TextBox x:Name="TotalFreightOnly" Margin="10,5,10,5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
<TextBlock x:Name="lblTotalFreight" Text="Gesamtsumme netto" Margin="10,5,10,5"/>
<TextBox x:Name="TotalFreight" Margin="10,5,10,5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
<TextBlock x:Name="lblTotalVAT" Text="Mehrwertsteuer" Margin="10,5,10,5"/>
<TextBox x:Name="TotalVAT" Margin="10,5,10,5"/>
</StackPanel>
<StackPanel Orientation="Horizontal" VerticalAlignment="Stretch">
<TextBlock x:Name="lblTotalGross" Text="Gesamtsumme brutto" Margin="10,5,10,5"/>
<TextBox x:Name="TotalGross" Margin="10,5,10,5"/>
</StackPanel>
</StackPanel>
<!--SelectedLineItem-->
<!--<DataGrid x:Name="LineItemsViewModel1"
AutoGenerateColumns="True"
CanUserAddRows="False"
Height="300"
Width ="1280"
Margin="10,5,10,5"
AlternatingRowBackground="LightGray"/>-->
</Grid>
</Grid>
</UserControl>