@ -10,9 +10,9 @@ namespace Gremlin.MVVM
{
{
private string _quoteType = "ein Analysegerät" ;
private string _quoteType = "ein Analysegerät" ;
private string _quotePath ;
private string _quotePath ;
private List < LineItemV M> _lineItemsVM ;
private List < LineItemV iew Model > _lineItemsVM ;
private ContactV M _recipient ;
private ContactV iew Model _recipient ;
private ContactV M _salesRep ;
private ContactV iew Model _salesRep ;
private string _quoteNumber ;
private string _quoteNumber ;
private int _warranty = 12 ;
private int _warranty = 12 ;
private int _validity = 60 ;
private int _validity = 60 ;
@ -41,9 +41,9 @@ namespace Gremlin.MVVM
public bool? UseMailTemplate { get = > _useMailTemplate ; internal set { _useMailTemplate = value ; NotifyOfPropertyChange ( ( ) = > UseMailTemplate ) ; } }
public bool? UseMailTemplate { get = > _useMailTemplate ; internal set { _useMailTemplate = value ; NotifyOfPropertyChange ( ( ) = > UseMailTemplate ) ; } }
public bool? ShowDiscounts { get = > _showDiscounts ; internal set { _showDiscounts = value ; NotifyOfPropertyChange ( ( ) = > ShowDiscounts ) ; } }
public bool? ShowDiscounts { get = > _showDiscounts ; internal set { _showDiscounts = value ; NotifyOfPropertyChange ( ( ) = > ShowDiscounts ) ; } }
public List < LineItemV M> LineItemsVM { get = > _lineItemsVM ; private set = > _lineItemsVM = value ; }
public List < LineItemV iew Model > LineItemsVM { get = > _lineItemsVM ; private set = > _lineItemsVM = value ; }
public ContactV M Recipient { get = > _recipient ; internal set = > _recipient = value ; }
public ContactV iew Model Recipient { get = > _recipient ; internal set = > _recipient = value ; }
public ContactV M SalesRep { get = > _salesRep ; private set = > _salesRep = value ; }
public ContactV iew Model SalesRep { get = > _salesRep ; private set = > _salesRep = value ; }
public decimal TotalListprice { get = > _totalListprice ; private set = > _totalListprice = value ; }
public decimal TotalListprice { get = > _totalListprice ; private set = > _totalListprice = value ; }
public decimal AverageDiscount { get = > _averageDiscount ; private set = > _averageDiscount = value ; }
public decimal AverageDiscount { get = > _averageDiscount ; private set = > _averageDiscount = value ; }
public decimal TotalNet { get = > _totalNet ; private set = > _totalNet = value ; }
public decimal TotalNet { get = > _totalNet ; private set = > _totalNet = value ; }
@ -51,7 +51,7 @@ namespace Gremlin.MVVM
public bool QuoteContains3PP { get = > _quoteContains3PP ; private set = > _quoteContains3PP = value ; }
public bool QuoteContains3PP { get = > _quoteContains3PP ; private set = > _quoteContains3PP = value ; }
public bool QuoteContainsRB { get = > _quoteContainsRB ; private set = > _quoteContainsRB = value ; }
public bool QuoteContainsRB { get = > _quoteContainsRB ; private set = > _quoteContainsRB = value ; }
internal QuoteViewModel ( ContactV M salesRep )
internal QuoteViewModel ( ContactV iew Model salesRep )
{
{
Random random = new ( ) ;
Random random = new ( ) ;
SalesRep = salesRep ;
SalesRep = salesRep ;
@ -65,7 +65,7 @@ namespace Gremlin.MVVM
public QuoteViewModel ( ) { }
public QuoteViewModel ( ) { }
private QuoteViewModel ( string quoteNumber , string quoteType , ContactV M recipient , ContactV M 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 , ContactV iew Model recipient , ContactV iew Model salesRep , bool? brutto , float vAT , int warranty , int validity , string quotePath , bool? singlePrices , bool? brochures , bool? dataSheets , bool? mailTemplate , bool? showDiscounts )
{
{
QuoteNumber = quoteNumber ;
QuoteNumber = quoteNumber ;
QuoteType = quoteType ;
QuoteType = quoteType ;
@ -83,7 +83,7 @@ namespace Gremlin.MVVM
ShowDiscounts = showDiscounts ;
ShowDiscounts = showDiscounts ;
}
}
internal static QuoteViewModel CreateQuote ( string quoteNumber , ContactV M recipient , ContactV M 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 , ContactV iew Model recipient , ContactV iew Model 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 ;
decimal totalListprice = 0 , totalDiscount = 0 , calcTotalNet = 0 ;
bool quoteContains3PP = false , quoteContainsRB = false ;
bool quoteContains3PP = false , quoteContainsRB = false ;
@ -91,11 +91,11 @@ namespace Gremlin.MVVM
QuoteViewModel quoteVM = new ( quoteNumber , quoteType , recipient , salesRep , brutto , vAT , warranty , validity , quotePath , singlePrices , brochures , dataSheets , mailTemplate , showDiscounts ) ;
QuoteViewModel quoteVM = new ( quoteNumber , quoteType , recipient , salesRep , brutto , vAT , warranty , validity , quotePath , singlePrices , brochures , dataSheets , mailTemplate , showDiscounts ) ;
quoteVM . LineItemsVM = new ( ) ;
quoteVM . LineItemsVM = new ( ) ;
ObservableCollection < LineItemV M> lineItemsVM = LineItemV M. ReadLineItemsFromClipboard ( ) ;
ObservableCollection < LineItemV iew Model > lineItemsVM = LineItemV iew Model . ReadLineItemsFromClipboard ( ) ;
if ( lineItemsVM = = null ) return null ;
if ( lineItemsVM = = null ) return null ;
foreach ( LineItemV M lineItemVM in lineItemsVM )
foreach ( LineItemV iew Model lineItemVM in lineItemsVM )
{
{
totalListprice + = lineItemVM . ListPrice ;
totalListprice + = lineItemVM . ListPrice ;
totalDiscount + = lineItemVM . TotalDiscount ;
totalDiscount + = lineItemVM . TotalDiscount ;