|
|
|
|
@ -2,10 +2,12 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Gremlin.MVVM
|
|
|
|
|
{
|
|
|
|
|
public class QuoteViewModel : PropertyChangedBase
|
|
|
|
|
public class QuoteViewModel : PropertyChangedBase, IHandle<ShellViewModel>
|
|
|
|
|
{
|
|
|
|
|
private string _quoteType = "ein Analysegerät";
|
|
|
|
|
private string _quotePath;
|
|
|
|
|
@ -27,6 +29,7 @@ namespace Gremlin.MVVM
|
|
|
|
|
private bool _quoteContains3PP;
|
|
|
|
|
private bool _quoteContainsRB;
|
|
|
|
|
private bool? _showDiscounts = true;
|
|
|
|
|
private IEventAggregator _eventAggregator;
|
|
|
|
|
|
|
|
|
|
public string QuoteType { get => _quoteType; internal set { _quoteType = value; NotifyOfPropertyChange(() => QuoteType); } }
|
|
|
|
|
public string QuotePath { get => _quotePath; internal set { _quotePath = value; NotifyOfPropertyChange(() => QuotePath); } }
|
|
|
|
|
@ -62,7 +65,7 @@ namespace Gremlin.MVVM
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public QuoteViewModel() { }
|
|
|
|
|
//public QuoteViewModel() { }
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
@ -82,6 +85,15 @@ namespace Gremlin.MVVM
|
|
|
|
|
ShowDiscounts = showDiscounts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public QuoteViewModel(IEventAggregator eventAggregator)
|
|
|
|
|
{
|
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public QuoteViewModel()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
{
|
|
|
|
|
decimal totalListprice = 0, totalDiscount = 0, calcTotalNet = 0;
|
|
|
|
|
@ -149,5 +161,10 @@ namespace Gremlin.MVVM
|
|
|
|
|
{
|
|
|
|
|
LineItemsViewModel = LineItemViewModel.ReadLineItemsFromClipboard();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Task HandleAsync(ShellViewModel message, CancellationToken cancellationToken)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|