|
|
|
|
@ -9,28 +9,29 @@ namespace Gremlin.GremlinUI.ViewModels
|
|
|
|
|
internal class QuoteVM : BaseVM
|
|
|
|
|
{
|
|
|
|
|
public List<LineItemVM> LineItemsVM { get; private set; }
|
|
|
|
|
public ContactVM Recipient { get; set; }
|
|
|
|
|
public ContactVM Recipient { get; internal set; }
|
|
|
|
|
public ContactVM SalesRep { get; private set; }
|
|
|
|
|
public string QuoteNumber { get; set; }
|
|
|
|
|
public string QuoteType { get; set; }
|
|
|
|
|
public string QuotePath { get; set; }
|
|
|
|
|
public int Warranty { get; set; }
|
|
|
|
|
public int Validity { get; set; }
|
|
|
|
|
public string QuoteNumber { get; internal set; }
|
|
|
|
|
public string QuoteType { get; internal set; }
|
|
|
|
|
public string QuotePath { get; internal set; }
|
|
|
|
|
public int Warranty { get; internal set; }
|
|
|
|
|
public int Validity { get; internal set; }
|
|
|
|
|
public decimal TotalListprice { get; private set; }
|
|
|
|
|
public decimal AverageDiscount { get; private set; }
|
|
|
|
|
public decimal TotalNet { get; private set; }
|
|
|
|
|
public float VAT { get; private set; }
|
|
|
|
|
public bool? Brutto { get; set; }
|
|
|
|
|
public bool? SinglePrices { get; set; }
|
|
|
|
|
public bool? Brochures { get; set; }
|
|
|
|
|
public bool? DataSheets { get; set; }
|
|
|
|
|
public bool? MailTemplate { get; set; }
|
|
|
|
|
public bool? Brutto { get; internal set; }
|
|
|
|
|
public bool? SinglePrices { get; internal set; }
|
|
|
|
|
public bool? Brochures { get; internal set; }
|
|
|
|
|
public bool? DataSheets { get; internal set; }
|
|
|
|
|
public bool? MailTemplate { get; internal set; }
|
|
|
|
|
public bool QuoteContains3PP { get; private set; }
|
|
|
|
|
public bool QuoteContainsRB { get; private set; }
|
|
|
|
|
public bool? ShowDiscounts { get; internal set; }
|
|
|
|
|
|
|
|
|
|
internal QuoteVM() { }
|
|
|
|
|
|
|
|
|
|
private QuoteVM(string quoteNumber, string quoteType, ContactVM recipient, ContactVM salesRep, bool? brutto, float vAT, int warranty, int validity, string quotePath, bool? singlePrices, bool? brochures, bool? dataSheets, bool? mailTemplate)
|
|
|
|
|
private QuoteVM(string quoteNumber, string quoteType, ContactVM recipient, ContactVM salesRep, bool? brutto, float vAT, int warranty, int validity, string quotePath, bool? singlePrices, bool? brochures, bool? dataSheets, bool? mailTemplate, bool? showDiscounts)
|
|
|
|
|
{
|
|
|
|
|
QuoteNumber = quoteNumber;
|
|
|
|
|
QuoteType = quoteType;
|
|
|
|
|
@ -45,17 +46,21 @@ namespace Gremlin.GremlinUI.ViewModels
|
|
|
|
|
Brochures = brochures;
|
|
|
|
|
DataSheets = dataSheets;
|
|
|
|
|
MailTemplate = mailTemplate;
|
|
|
|
|
ShowDiscounts = showDiscounts;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
internal static QuoteVM CreateQuote(string quoteNumber, ContactVM recipient, ContactVM 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)
|
|
|
|
|
internal static QuoteVM CreateQuote(string quoteNumber, ContactVM recipient, ContactVM 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;
|
|
|
|
|
bool quoteContains3PP = false, quoteContainsRB = false;
|
|
|
|
|
|
|
|
|
|
QuoteVM quoteVM = new(quoteNumber, quoteType, recipient, salesRep, brutto, vAT, warranty, validity, quotePath, singlePrices, brochures, dataSheets, mailTemplate);
|
|
|
|
|
QuoteVM quoteVM = new(quoteNumber, quoteType, recipient, salesRep, brutto, vAT, warranty, validity, quotePath, singlePrices, brochures, dataSheets, mailTemplate, showDiscounts);
|
|
|
|
|
quoteVM.LineItemsVM = new();
|
|
|
|
|
|
|
|
|
|
ObservableCollection<LineItemVM> lineItemsVM = LineItemVM.ReadLineItemsFromClipboard();
|
|
|
|
|
|
|
|
|
|
if (lineItemsVM == null) return null;
|
|
|
|
|
|
|
|
|
|
foreach (LineItemVM lineItemVM in lineItemsVM)
|
|
|
|
|
{
|
|
|
|
|
totalListprice += lineItemVM.ListPrice;
|
|
|
|
|
|