diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj
index 2204004c0..a7ba47c65 100644
--- a/BeWo/BeWo.csproj
+++ b/BeWo/BeWo.csproj
@@ -994,6 +994,7 @@
+
diff --git a/BeWo/BeWoApp.xaml b/BeWo/BeWoApp.xaml
index 8ae49c75d..4266c9e95 100644
--- a/BeWo/BeWoApp.xaml
+++ b/BeWo/BeWoApp.xaml
@@ -95,6 +95,7 @@
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
-
+
+
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
+
+
diff --git a/BeWo/View/Detail/Accounting/NewGkvAbrechnungPopUpView.xaml.cs b/BeWo/View/Detail/Accounting/NewGkvAbrechnungPopUpView.xaml.cs
index a081564c1..c58b85fff 100644
--- a/BeWo/View/Detail/Accounting/NewGkvAbrechnungPopUpView.xaml.cs
+++ b/BeWo/View/Detail/Accounting/NewGkvAbrechnungPopUpView.xaml.cs
@@ -16,268 +16,271 @@ using DevExpress.Xpf.Grid;
namespace BeWo.View.Detail.Accounting
{
- public partial class NewGkvAbrechnungPopUpView : BeWoView
- {
- private long? _LoadedInvoiceBaseOid;
+ public partial class NewGkvAbrechnungPopUpView : BeWoView
+ {
+ private long? _LoadedInvoiceBaseOid;
- private List _InvoiceBaseDCs;
+ private List _InvoiceBaseDCs;
- private List _InvoiceNumbers;
+ private List _InvoiceNumbers;
- private GkvAbrechnungVM _Viewmodel;
+ private GkvAbrechnungVM _Viewmodel;
- public event EventHandler> CreateButtonClicked;
+ public event EventHandler> CreateButtonClicked;
- public event EventHandler CancelButtonClicked;
+ public event EventHandler CancelButtonClicked;
- public NewGkvAbrechnungPopUpView()
- {
- this.InitializeComponent();
+ public NewGkvAbrechnungPopUpView()
+ {
+ this.InitializeComponent();
- this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close,
- (s, e) =>
- {
- this._InvoiceBaseDCs?.Clear();
- if (CancelButtonClicked != null)
- CancelButtonClicked.Invoke(s, e);
- }));
+ this.CommandBindings.Add(new CommandBinding(ApplicationCommands.Close,
+ (s, e) =>
+ {
+ this._InvoiceBaseDCs?.Clear();
+ if (CancelButtonClicked != null)
+ CancelButtonClicked.Invoke(s, e);
+ }));
- this.grid_newInvoices.View.Loaded += (s, e) => ((TableView)this.grid_newInvoices.View).BestFitColumns();
- }
+ this.grid_newInvoices.View.Loaded += (s, e) => ((TableView)this.grid_newInvoices.View).BestFitColumns();
+ }
- public GkvAbrechnungVM ViewModel
- {
- get
- {
- return this._Viewmodel;
- }
+ public GkvAbrechnungVM ViewModel
+ {
+ get
+ {
+ return this._Viewmodel;
+ }
- set
- {
- this.DataContext = value;
- this._Viewmodel = value;
- }
- }
+ set
+ {
+ this.DataContext = value;
+ this._Viewmodel = value;
+ }
+ }
- public DateTime FilterStart
- {
- get => ViewModel.AbrechnungsZeitraumStart.Value;
- set => ViewModel.AbrechnungsZeitraumStart = value;
- }
- public DateTime FilterEnde
- {
- get => ViewModel.AbrechnungsZeitraumEnde.Value;
- set => ViewModel.AbrechnungsZeitraumEnde = value;
- }
+ public DateTime FilterStart
+ {
+ get => ViewModel.AbrechnungsZeitraumStart.Value;
+ set => ViewModel.AbrechnungsZeitraumStart = value;
+ }
+ public DateTime FilterEnde
+ {
+ get => ViewModel.AbrechnungsZeitraumEnde.Value;
+ set => ViewModel.AbrechnungsZeitraumEnde = value;
+ }
- public List InvoiceBaseDcs
- {
- set
- {
- this._InvoiceNumbers = value.Select(i => i.InvoiceNumber).ToList();
- this._InvoiceBaseDCs = new List(value);
- this.grid_newInvoices.ItemsSource = this._InvoiceBaseDCs;
- }
- }
+ public List InvoiceBaseDcs
+ {
+ set
+ {
+ this._InvoiceNumbers = value.Select(i => i.InvoiceNumber).ToList();
+ this._InvoiceBaseDCs = new List(value);
+ this.grid_newInvoices.ItemsSource = this._InvoiceBaseDCs;
+ }
+ }
- private void Fire()
- {
- if (this.CreateButtonClicked != null)
- {
- if (_InvoiceBaseDCs == null)
- _InvoiceBaseDCs = new List();
+ private void Fire()
+ {
+ if (this.CreateButtonClicked != null)
+ {
+ if (_InvoiceBaseDCs == null)
+ _InvoiceBaseDCs = new List();
- for (int i = 0; i < _InvoiceBaseDCs.Count; i++)
- {
- _InvoiceBaseDCs[i].InvoiceNumber = this._InvoiceNumbers[i];
- }
+ for (int i = 0; i < _InvoiceBaseDCs.Count; i++)
+ {
+ _InvoiceBaseDCs[i].InvoiceNumber = this._InvoiceNumbers[i];
+ }
- var gkvAbrechnung = ViewModel.CommitToDataContract();
+ var gkvAbrechnung = ViewModel.CommitToDataContract();
- this.CreateButtonClicked(this, new EventArgs(gkvAbrechnung));
- }
- }
- public void Clear()
- {
- _LoadedInvoiceBaseOid = null;
- popupedit_GkvSearch.Text = string.Empty;
- popupedit_GkvSearch.Focus();
- }
+ this.CreateButtonClicked(this, new EventArgs(gkvAbrechnung));
+ }
+ }
+ public void Clear()
+ {
+ _LoadedInvoiceBaseOid = null;
+ popupedit_GkvSearch.Text = string.Empty;
+ popupedit_GkvSearch.Focus();
+ }
- private void btn_cancel_Click(object sender, RoutedEventArgs e)
- {
- if (ViewModel.InvoiceBases != null)
- ViewModel.InvoiceBases.Clear();
- this.CancelButtonClicked(this, e);
- }
- private void btn_create_Click(object sender, RoutedEventArgs e)
- {
- this.Fire();
- }
+ private void btn_cancel_Click(object sender, RoutedEventArgs e)
+ {
+ if (ViewModel.InvoiceBases != null)
+ ViewModel.InvoiceBases.Clear();
+ this.CancelButtonClicked(this, e);
+ }
+ private void btn_create_Click(object sender, RoutedEventArgs e)
+ {
+ this.Fire();
+ }
- private void TableView_CellValueChanging(object sender, CellValueChangedEventArgs e)
- {
- var si = e.Row as InvoiceBaseDC;
- if (e.Column.FieldName.Contains("NeuErstellen") && ((bool)e.Value))
- {
- if (si.DiffErstellen)
- {
- si.DiffErstellen = false;
- grid_newInvoices.RefreshData();
- }
- }
- else if (e.Column.FieldName.Contains("DiffErstellen") && ((bool)e.Value))
- {
- if (si.NeuErstellen)
- {
- si.NeuErstellen = false;
- grid_newInvoices.RefreshData();
- }
- }
- }
-
- private void popupedit_GkvSearch_PopUpClick(object sender, RoutedEventArgs e)
- {
- gkvsearchview.ItemSelected += gkvsearchview_OrganisationSelected;
- popup_organisation.IsOpen = true;
- }
- private void gkvsearchview_OrganisationSelected(object sender, EventArgs e)
- {
- popup_organisation.IsOpen = false;
- gkvsearchview.ItemSelected -= gkvsearchview_OrganisationSelected;
+ private void TableView_CellValueChanging(object sender, CellValueChangedEventArgs e)
+ {
+ var si = e.Row as InvoiceBaseDC;
+ if (e.Column.FieldName.Contains("NeuErstellen") && ((bool)e.Value))
+ {
+ if (si.DiffErstellen)
+ {
+ si.DiffErstellen = false;
+ grid_newInvoices.RefreshData();
+ }
+ }
+ else if (e.Column.FieldName.Contains("DiffErstellen") && ((bool)e.Value))
+ {
+ if (si.NeuErstellen)
+ {
+ si.NeuErstellen = false;
+ grid_newInvoices.RefreshData();
+ }
+ }
+ }
- popupedit_GkvSearch.Text = e.Data.ToString();
- popupedit_GkvSearch.Focus();
+ private void popupedit_GkvSearch_PopUpClick(object sender, RoutedEventArgs e)
+ {
+ gkvsearchview.ItemSelected += gkvsearchview_OrganisationSelected;
+ popup_organisation.IsOpen = true;
+ }
+ private void gkvsearchview_OrganisationSelected(object sender, EventArgs e)
+ {
+ popup_organisation.IsOpen = false;
+ gkvsearchview.ItemSelected -= gkvsearchview_OrganisationSelected;
- RefreshInvoiceBases(e.Data.OrganisationOid);
- }
+ popupedit_GkvSearch.Text = e.Data.ToString();
+ popupedit_GkvSearch.Focus();
- private void RefreshInvoiceBases() => RefreshInvoiceBases(_LoadedInvoiceBaseOid);
- private void RefreshInvoiceBases(DateTime? start, DateTime? ende) => RefreshInvoiceBases(_LoadedInvoiceBaseOid, start ?? FilterStart, ende ?? FilterEnde);
- private void RefreshInvoiceBases(long? costOid) => RefreshInvoiceBases(costOid, FilterStart, FilterEnde);
- private void RefreshInvoiceBases(long? costOid, DateTime? start, DateTime? ende)
- {
- if (costOid != null && start != null && ende != null && ende >= start)
- {
- _LoadedInvoiceBaseOid = costOid;
+ RefreshInvoiceBases(e.Data.OrganisationOid);
+ }
- ServiceFacade.DoAccountingServiceAsync(s => s.GetInvoiceBasesForCostBearerAndId(start, ende, (long)costOid, "RechnungSoziotherapie"), UpdateInvoiceList);
- }
- }
+ private void RefreshInvoiceBases() => RefreshInvoiceBases(_LoadedInvoiceBaseOid);
+ private void RefreshInvoiceBases(DateTime? start, DateTime? ende) => RefreshInvoiceBases(_LoadedInvoiceBaseOid, start ?? FilterStart, ende ?? FilterEnde);
+ private void RefreshInvoiceBases(long? costOid) => RefreshInvoiceBases(costOid, FilterStart, FilterEnde);
+ private void RefreshInvoiceBases(long? costOid, DateTime? start, DateTime? ende)
+ {
+ if (costOid != null && start != null && ende != null && ende >= start)
+ {
+ _LoadedInvoiceBaseOid = costOid;
- private void UpdateInvoiceList(IList dcList)
- {
- this.Dispatcher.BeginInvoke(
- DispatcherPriority.Normal,
- (Action)delegate
- {
- BindingList invoiceBaseVMs = new BindingList();
- foreach (var invoiceBaseDC in dcList)
- {
- InvoiceBaseVM invoiceBaseVM = new InvoiceBaseVM(invoiceBaseDC);
- invoiceBaseVM.IsChecked = false;
- invoiceBaseVMs.Add(invoiceBaseVM);
- }
- ViewModel.InvoiceBases = invoiceBaseVMs;
- grid_newInvoices.ItemsSource = ViewModel.InvoiceBases;
- this.gridView.BestFitColumns();
- });
- }
+ ServiceFacade.DoAccountingServiceAsync(s => s.GetInvoiceBasesForCostBearerAndId(start, ende, (long)costOid, "RechnungSoziotherapie"), UpdateInvoiceList);
+ }
+ }
- private void popupedit_DatenannahmestelleSearch_PopUpClick(object sender, RoutedEventArgs e)
- {
- // tbd
- }
+ private void UpdateInvoiceList(IList dcList)
+ {
+ this.Dispatcher.BeginInvoke(
+ DispatcherPriority.Normal,
+ (Action)delegate
+ {
+ BindingList invoiceBaseVMs = new BindingList();
+ foreach (var invoiceBaseDC in dcList)
+ {
+ InvoiceBaseVM invoiceBaseVM = new InvoiceBaseVM(invoiceBaseDC);
+ invoiceBaseVM.IsChecked = false;
+ invoiceBaseVMs.Add(invoiceBaseVM);
+ }
+ ViewModel.InvoiceBases = invoiceBaseVMs;
+ grid_newInvoices.ItemsSource = ViewModel.InvoiceBases;
+ this.gridView.BestFitColumns();
+ });
+ }
- private void button_checkAll_Click(object sender, RoutedEventArgs e)
- {
- var visible = GetVisibleVMs();
- foreach (var item in visible)
- {
- item.IsChecked = true;
- }
- }
- private void button_uncheckAll_Click(object sender, RoutedEventArgs e)
- {
- var visible = GetVisibleVMs();
- foreach (var item in visible)
- {
- item.IsChecked = false;
- }
- }
+ private void popupedit_DatenannahmestelleSearch_PopUpClick(object sender, RoutedEventArgs e)
+ {
+ // tbd
+ }
+
+ private void button_checkAll_Click(object sender, RoutedEventArgs e)
+ {
+ var visible = GetVisibleAndValidVMs();
+ foreach (var item in visible)
+ {
+ item.IsChecked = true;
+ }
+ }
+ private void button_uncheckAll_Click(object sender, RoutedEventArgs e)
+ {
+ var visible = GetVisibleAndValidVMs();
+ foreach (var item in visible)
+ {
+ item.IsChecked = false;
+ }
+ }
- private IList GetVisibleVMs()
- {
- var list = new List();
+ private IList GetVisibleAndValidVMs()
+ {
+ var list = new List();
- var items = grid_newInvoices.ItemsSource as IList;
+ var items = grid_newInvoices.ItemsSource as IList;
- if (items != null)
- {
- for (int i = 0; i < items.Count; i++)
- {
- if (grid_newInvoices.IsRowVisible(i))
- {
- var vm = grid_newInvoices.GetRow(i) as InvoiceBaseVM;
- if (vm != null)
- {
- list.Add(vm);
- }
- }
- }
- }
+ if (items is null)
+ return list;
- return list;
- }
+ for (int i = 0; i < items.Count; i++)
+ {
+ if (!grid_newInvoices.IsRowVisible(i))
+ continue;
- private void DateEdit_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
- {
- if (_Viewmodel is null)
- return;
+ var vm = grid_newInvoices.GetRow(i) as InvoiceBaseVM;
+ if (vm is null)
+ continue;
- if (FilterStart == (DateTime)e.NewValue)
- return;
+ if (!vm.IsGkvValid)
+ continue;
- // Von
- FilterStart = (DateTime)e.NewValue;
+ list.Add(vm);
+ }
- if(FilterEnde < FilterStart)
- {
- FilterEnde = new DateTime(FilterStart.Year, FilterStart.Month, 1).AddMonths(1).AddTicks(-1);
- }
+ return list;
+ }
- if(FilterEnde.Year != FilterStart.Year)
- {
- FilterEnde = new DateTime(FilterStart.Year, FilterStart.Month, 1).AddMonths(1).AddTicks(-1);
- }
+ private void DateEdit_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
+ {
+ if (_Viewmodel is null)
+ return;
- RefreshInvoiceBases();
- }
+ if (FilterStart == (DateTime)e.NewValue)
+ return;
- private void DateEdit2_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
- {
- if (_Viewmodel is null)
- return;
+ // Von
+ FilterStart = (DateTime)e.NewValue;
- if (FilterEnde == (DateTime)e.NewValue)
- return;
+ if (FilterEnde < FilterStart)
+ {
+ FilterEnde = new DateTime(FilterStart.Year, FilterStart.Month, 1).AddMonths(1).AddTicks(-1);
+ }
- // Bis
- FilterEnde = (DateTime)e.NewValue;
+ if (FilterEnde.Year != FilterStart.Year)
+ {
+ FilterEnde = new DateTime(FilterStart.Year, FilterStart.Month, 1).AddMonths(1).AddTicks(-1);
+ }
- if (FilterEnde < FilterStart)
- {
- FilterStart = new DateTime(FilterEnde.Year, 1, 1);
- }
+ RefreshInvoiceBases();
+ }
- if (FilterEnde.Year != FilterStart.Year)
- {
- FilterStart = new DateTime(FilterEnde.Year, FilterEnde.Month, 1);
- }
+ private void DateEdit2_EditValueChanged(object sender, DevExpress.Xpf.Editors.EditValueChangedEventArgs e)
+ {
+ if (_Viewmodel is null)
+ return;
- RefreshInvoiceBases();
- }
- }
+ if (FilterEnde == (DateTime)e.NewValue)
+ return;
+
+ // Bis
+ FilterEnde = (DateTime)e.NewValue;
+
+ if (FilterEnde < FilterStart)
+ {
+ FilterStart = new DateTime(FilterEnde.Year, 1, 1);
+ }
+
+ if (FilterEnde.Year != FilterStart.Year)
+ {
+ FilterStart = new DateTime(FilterEnde.Year, FilterEnde.Month, 1);
+ }
+
+ RefreshInvoiceBases();
+ }
+ }
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/InvoiceBaseVM.cs b/BeWo/ViewModel/InvoiceBaseVM.cs
index c7f3b0158..bb25d0b26 100644
--- a/BeWo/ViewModel/InvoiceBaseVM.cs
+++ b/BeWo/ViewModel/InvoiceBaseVM.cs
@@ -13,1110 +13,1100 @@ using BS.Shared.Translation;
namespace BeWo.ViewModel
{
- public class InvoiceBaseVM : AbstractDCMapperVM
- {
- #region Constants and Fields
+ public class InvoiceBaseVM : AbstractDCMapperVM
+ {
+ public static string PropertyName_AccountingPeriodEnd = "AccountingPeriodEnd";
- public static string PropertyName_AccountingPeriodEnd = "AccountingPeriodEnd";
+ public static string PropertyName_AccountingPeriodStart = "AccountingPeriodStart";
- public static string PropertyName_AccountingPeriodStart = "AccountingPeriodStart";
+ public static string PropertyName_CreatorFirstName = "CreatorFirstName";
- public static string PropertyName_CreatorFirstName = "CreatorFirstName";
+ public static string PropertyName_CreatorLastName = "CreatorLastName";
- public static string PropertyName_CreatorLastName = "CreatorLastName";
+ public static string PropertyName_CustomerReferenceNumber = "CustomerReferenceNumber";
- public static string PropertyName_CustomerReferenceNumber = "CustomerReferenceNumber";
+ public static string PropertyName_DueDate = "DueDate";
- public static string PropertyName_DueDate = "DueDate";
+ public static string PropertyName_DunningLetterCount = "DunningLetterCount";
- public static string PropertyName_DunningLetterCount = "DunningLetterCount";
+ public static string PropertyName_InvoiceDate = "InvoiceDate";
- public static string PropertyName_InvoiceDate = "InvoiceDate";
+ public static string PropertyName_InvoiceItems = "InvoiceItems";
- public static string PropertyName_InvoiceItems = "InvoiceItems";
+ public static string PropertyName_InvoiceNumber = "InvoiceNumber";
- public static string PropertyName_InvoiceNumber = "InvoiceNumber";
+ public static string PropertyName_InvoiceTitle = "InvoiceTitle";
- public static string PropertyName_InvoiceTitle = "InvoiceTitle";
+ public static string PropertyName_NeuErstellen = "NeuErstellen";
- public static string PropertyName_NeuErstellen = "NeuErstellen";
+ public static string PropertyName_DiffErstellen = "DiffErstellen";
- public static string PropertyName_DiffErstellen = "DiffErstellen";
+ public static string PropertyName_IsReviewed = "IsReviewed";
- public static string PropertyName_IsReviewed = "IsReviewed";
+ public static string PropertyName_IsSent = "IsSent";
- public static string PropertyName_IsSent = "IsSent";
+ public static string PropertyName_IsExported = "IsExported";
- public static string PropertyName_IsExported = "IsExported";
+ public static string PropertyName_IsPaid = "IsPaid";
- public static string PropertyName_IsPaid = "IsPaid";
+ public static string PropertyName_PartialPayment = "PartialPayment";
- public static string PropertyName_PartialPayment = "PartialPayment";
+ public static string PropertyName_Notice = "Notice";
- public static string PropertyName_Notice = "Notice";
+ public static string PropertyName_RecipientCostBearerOid = "RecipientCostBearerOid";
- public static string PropertyName_RecipientCostBearerOid = "RecipientCostBearerOid";
+ public static string PropertyName_RecipientCustomerOid = "RecipientCustomerOid";
- public static string PropertyName_RecipientCustomerOid = "RecipientCustomerOid";
+ public static string PropertyName_RecipientDivision = "RecipientDivision";
- public static string PropertyName_RecipientDivision = "RecipientDivision";
+ public static string PropertyName_RecipientOrganisation = "RecipientOrganisation";
- public static string PropertyName_RecipientOrganisation = "RecipientOrganisation";
+ public static string PropertyName_RecipientOrganisationOid = "RecipientOrganisationOid";
- public static string PropertyName_RecipientOrganisationOid = "RecipientOrganisationOid";
+ public static string PropertyName_RecipientPostBox = "RecipientPostBox";
- public static string PropertyName_RecipientPostBox = "RecipientPostBox";
+ public static string PropertyName_RecipientPersonFirstName = "RecipientPersonFirstName";
- public static string PropertyName_RecipientPersonFirstName = "RecipientPersonFirstName";
+ public static string PropertyName_RecipientPersonLastName = "RecipientPersonLastName";
- public static string PropertyName_RecipientPersonLastName = "RecipientPersonLastName";
+ public static string PropertyName_RecipientPersonOid = "RecipientPersonOid";
- public static string PropertyName_RecipientPersonOid = "RecipientPersonOid";
+ public static string PropertyName_RecipientPostCode = "RecipientPostCode";
- public static string PropertyName_RecipientPostCode = "RecipientPostCode";
+ public static string PropertyName_RecipientAddressLine1 = "RecipientAddressLine1";
- public static string PropertyName_RecipientAddressLine1 = "RecipientAddressLine1";
+ public static string PropertyName_RecipientStreet = "RecipientStreet";
- public static string PropertyName_RecipientStreet = "RecipientStreet";
+ public static string PropertyName_RecipientTown = "RecipientTown";
- public static string PropertyName_RecipientTown = "RecipientTown";
+ public static string PropertyName_ReportLink = "ReportLink";
- public static string PropertyName_ReportLink = "ReportLink";
+ public static string PropertyName_SenderDivision = "SenderDivision";
- public static string PropertyName_SenderDivision = "SenderDivision";
+ public static string PropertyName_SenderFax = "SenderFax";
- public static string PropertyName_SenderFax = "SenderFax";
+ public static string PropertyName_SenderFirstName = "SenderFirstName";
- public static string PropertyName_SenderFirstName = "SenderFirstName";
+ public static string PropertyName_SenderLastName = "SenderLastName";
- public static string PropertyName_SenderLastName = "SenderLastName";
+ public static string PropertyName_SenderOrganisation = "SenderOrganisation";
- public static string PropertyName_SenderOrganisation = "SenderOrganisation";
+ public static string PropertyName_SenderPhone = "SenderPhone";
- public static string PropertyName_SenderPhone = "SenderPhone";
+ public static string PropertyName_SupportConceptOid = "SupportConceptOid";
- public static string PropertyName_SupportConceptOid = "SupportConceptOid";
+ public static string PropertyName_TotalAmount = "TotalAmount";
- public static string PropertyName_TotalAmount = "TotalAmount";
+ public static string PropertyName_TypeString = "TypeString";
- public static string PropertyName_TypeString = "TypeString";
+ private readonly Dictionary _TypeTranslation = new Dictionary
+ {
+ {
+ InvoiceType.CustomerEquity, Translator.Translate("Eigenanteil")
+ },
+ {
+ InvoiceType.General, Translator.Translate("Allgemein")
+ },
+ {
+ InvoiceType.Settlement, Translator.Translate("Spitzabrechnung")
+ },
+ {
+ InvoiceType.Service, Translator.Translate("Rechnung")
+ }
+ };
- private readonly Dictionary _TypeTranslation = new Dictionary
- {
- {
- InvoiceType.CustomerEquity, Translator.Translate("Eigenanteil")
- },
- {
- InvoiceType.General, Translator.Translate("Allgemein")
- },
- {
- InvoiceType.Settlement, Translator.Translate("Spitzabrechnung")
- },
- {
- InvoiceType.Service, Translator.Translate("Rechnung")
- }
- };
+ private DateTime? _AccountingPeriodEnd;
- private DateTime? _AccountingPeriodEnd;
+ private DateTime? _AccountingPeriodStart;
- private DateTime? _AccountingPeriodStart;
+ private string _CreatorFirstName = string.Empty;
- private string _CreatorFirstName = string.Empty;
+ private string _CreatorLastName = string.Empty;
- private string _CreatorLastName = string.Empty;
+ private string _CustomerReferenceNumber = string.Empty;
- private string _CustomerReferenceNumber = string.Empty;
+ private DateTime? _DueDate;
- private DateTime? _DueDate;
+ private int? _DunningLetterCount;
- private int? _DunningLetterCount;
+ private DateTime? _InvoiceDate;
- private DateTime? _InvoiceDate;
+ private InvoiceItemListVM _InvoiceItems;
- private InvoiceItemListVM _InvoiceItems;
+ private string _InvoiceNumber = string.Empty;
- private string _InvoiceNumber = string.Empty;
+ private string _InvoiceTitle = string.Empty;
- private string _InvoiceTitle = string.Empty;
+ internal bool _IsReviewed;
- internal bool _IsReviewed;
+ internal bool _IsSent;
- internal bool _IsSent;
+ internal bool _IsExported;
- internal bool _IsExported;
+ internal bool _IsPaid;
- internal bool _IsPaid;
+ private string _PartialPayment = string.Empty;
- private string _PartialPayment = string.Empty;
+ internal bool _NeuErstellen;
- internal bool _NeuErstellen;
+ internal bool _DiffErstellen;
- internal bool _DiffErstellen;
+ internal bool _IsChecked;
- internal bool _IsChecked;
+ private string _Notice = string.Empty;
- private string _Notice = string.Empty;
+ private long? _RecipientCostBearerOid;
- private long? _RecipientCostBearerOid;
+ private long? _RecipientCustomerOid;
- private long? _RecipientCustomerOid;
+ private string _RecipientDivision = string.Empty;
- private string _RecipientDivision = string.Empty;
+ private string _RecipientOrganisation = string.Empty;
- private string _RecipientOrganisation = string.Empty;
+ private long? _RecipientOrganisationOid;
- private long? _RecipientOrganisationOid;
+ private String _RecipientPostBox;
- private String _RecipientPostBox;
+ private string _RecipientPersonFirstName = string.Empty;
- private string _RecipientPersonFirstName = string.Empty;
+ private string _RecipientPersonLastName = string.Empty;
- private string _RecipientPersonLastName = string.Empty;
+ private long? _RecipientPersonOid;
- private long? _RecipientPersonOid;
+ private string _RecipientPostCode = string.Empty;
- private string _RecipientPostCode = string.Empty;
+ private string _RecipientAddressLine1 = string.Empty;
- private string _RecipientAddressLine1 = string.Empty;
+ private string _RecipientStreet = string.Empty;
- private string _RecipientStreet = string.Empty;
+ private string _RecipientTown = string.Empty;
- private string _RecipientTown = string.Empty;
+ private string _SenderDivision = string.Empty;
- private string _SenderDivision = string.Empty;
+ private string _SenderFax = string.Empty;
- private string _SenderFax = string.Empty;
+ private string _SenderFirstName = string.Empty;
- private string _SenderFirstName = string.Empty;
+ private string _SenderLastName = string.Empty;
- private string _SenderLastName = string.Empty;
+ private string _SenderOrganisation = string.Empty;
- private string _SenderOrganisation = string.Empty;
+ private string _SenderPhone = string.Empty;
- private string _SenderPhone = string.Empty;
+ private long? _SupportConceptOid;
- private long? _SupportConceptOid;
+ private decimal? _TotalAmount;
- private decimal? _TotalAmount;
+ public InvoiceBaseVM(InvoiceBaseDC pDC) : this(pDC, false) { }
- #endregion
+ public InvoiceBaseVM(InvoiceBaseDC pDC, bool isChecked = false)
+ : base(pDC, pDC.InvoiceBaseOid == null)
+ {
+ _IsChecked = isChecked;
+ }
- #region Constructors and Destructors
+ public bool IsGkvValid { get; private set; }
+ public string IsGkvValidError { get; private set; }
- public InvoiceBaseVM(InvoiceBaseDC pDC) : this(pDC, false) { }
-
- public InvoiceBaseVM(InvoiceBaseDC pDC, bool isChecked = false)
- : base(pDC, pDC.InvoiceBaseOid == null)
- {
- _IsChecked = isChecked;
- }
+ public bool IsChecked
+ {
+ get { return _IsChecked; }
- #endregion
+ set
+ {
+ if (AreDifferent(_IsChecked, value))
+ {
+ _IsChecked = value;
+ FirePropertyChanged("IsChecked");
+ }
+ }
+ }
- #region Properties
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public DateTime? AccountingPeriodEnd
+ {
+ get { return _AccountingPeriodEnd; }
- public bool IsChecked
- {
- get { return _IsChecked; }
+ set
+ {
+ if (AreDifferent(_AccountingPeriodEnd, value))
+ {
+ _AccountingPeriodEnd = value;
+ StoreDirtyInformation(AreDifferent(DataContract.AccountingPeriodEnd, value), PropertyName_AccountingPeriodEnd);
+ FirePropertyChanged(PropertyName_AccountingPeriodEnd);
+ }
+ }
+ }
- set
- {
- if (AreDifferent(_IsChecked, value))
- {
- _IsChecked = value;
- FirePropertyChanged("IsChecked");
- }
- }
- }
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public DateTime? AccountingPeriodStart
+ {
+ get { return _AccountingPeriodStart; }
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public DateTime? AccountingPeriodEnd
- {
- get { return _AccountingPeriodEnd; }
-
- set
- {
- if (AreDifferent(_AccountingPeriodEnd, value))
- {
- _AccountingPeriodEnd = value;
- StoreDirtyInformation(AreDifferent(DataContract.AccountingPeriodEnd, value), PropertyName_AccountingPeriodEnd);
- FirePropertyChanged(PropertyName_AccountingPeriodEnd);
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public DateTime? AccountingPeriodStart
- {
- get { return _AccountingPeriodStart; }
-
- set
- {
- if (AreDifferent(_AccountingPeriodStart, value))
- {
- _AccountingPeriodStart = value;
- StoreDirtyInformation(AreDifferent(DataContract.AccountingPeriodStart, value), PropertyName_AccountingPeriodStart);
- FirePropertyChanged(PropertyName_AccountingPeriodStart);
- }
- }
- }
-
- public string AccountingPeriodString
- {
- get
- {
- return _AccountingPeriodEnd.HasValue && _AccountingPeriodStart.HasValue
- ? _AccountingPeriodStart.Value.ToShortDateString() + " - " + _AccountingPeriodEnd.Value.ToShortDateString()
- : string.Empty;
- }
-
- set { }
- }
-
- public string CreatorFirstName
- {
- get { return _CreatorFirstName; }
-
- set
- {
- if (AreDifferent(_CreatorFirstName, value))
- {
- _CreatorFirstName = value;
- StoreDirtyInformation(AreDifferent(DataContract.CreatorFirstName, value), PropertyName_CreatorFirstName);
- FirePropertyChanged(PropertyName_CreatorFirstName);
- }
- }
- }
-
- public string CreatorLastName
- {
- get { return _CreatorLastName; }
-
- set
- {
- if (AreDifferent(_CreatorLastName, value))
- {
- _CreatorLastName = value;
- StoreDirtyInformation(AreDifferent(DataContract.CreatorLastName, value), PropertyName_CreatorLastName);
- FirePropertyChanged(PropertyName_CreatorLastName);
- }
- }
- }
-
- public string CustomerName
- {
- get
- {
- string result = string.Empty;
- if (!String.IsNullOrEmpty(DataContract.CustomerLastName))
- {
- result = DataContract.CustomerLastName;
- }
-
- if (!String.IsNullOrEmpty(DataContract.CustomerFirstName))
- {
- if (result.Length > 0)
- {
- result += ", ";
- }
-
- result += DataContract.CustomerFirstName;
- }
-
- return result;
- }
-
- set { }
- }
-
- public string CustomerReferenceNumber
- {
- get { return _CustomerReferenceNumber; }
-
- set
- {
- if (AreDifferent(_CustomerReferenceNumber, value))
- {
- _CustomerReferenceNumber = value;
- StoreDirtyInformation(AreDifferent(DataContract.CustomerReferenceNumber, value), PropertyName_CustomerReferenceNumber);
- FirePropertyChanged(PropertyName_CustomerReferenceNumber);
- }
- }
- }
-
- public DateTime? DueDate
- {
- get { return _DueDate; }
-
- set
- {
- if (AreDifferent(_DueDate, value))
- {
- _DueDate = value;
- StoreDirtyInformation(AreDifferent(DataContract.DueDate, value), PropertyName_DueDate);
- FirePropertyChanged(PropertyName_DueDate);
- }
- }
- }
-
- public int? DunningLetterCount
- {
- get { return _DunningLetterCount; }
-
- set
- {
- if (AreDifferent(_DunningLetterCount, value))
- {
- _DunningLetterCount = value;
- StoreDirtyInformation(AreDifferent(DataContract.DunningLetterCount, value), PropertyName_DunningLetterCount);
- FirePropertyChanged(PropertyName_DunningLetterCount);
- }
- }
- }
-
- [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
- public DateTime? InvoiceDate
- {
- get { return _InvoiceDate; }
-
- set
- {
- if (AreDifferent(_InvoiceDate, value))
- {
- _InvoiceDate = value;
- StoreDirtyInformation(AreDifferent(DataContract.InvoiceDate, value), PropertyName_InvoiceDate);
- FirePropertyChanged(PropertyName_InvoiceDate);
- }
- }
- }
-
- public InvoiceItemListVM InvoiceItems
- {
- get { return _InvoiceItems; }
-
- set
- {
- if (AreDifferent(_InvoiceItems, value))
- {
- _InvoiceItems = value;
- FirePropertyChanged(PropertyName_InvoiceItems);
- }
- }
- }
-
- public string InvoiceNumber
- {
- get { return _InvoiceNumber; }
-
- set
- {
- if (AreDifferent(_InvoiceNumber, value))
- {
- _InvoiceNumber = value;
- StoreDirtyInformation(AreDifferent(DataContract.InvoiceNumber, value), PropertyName_InvoiceNumber);
- FirePropertyChanged(PropertyName_InvoiceNumber);
- }
- }
- }
-
- public string InvoiceTitle
- {
- get { return _InvoiceTitle; }
-
- set
- {
- if (AreDifferent(_InvoiceTitle, value))
- {
- _InvoiceTitle = value;
- StoreDirtyInformation(AreDifferent(DataContract.InvoiceTitle, value), PropertyName_InvoiceTitle);
- FirePropertyChanged(PropertyName_InvoiceTitle);
- }
- }
- }
-
- public string Details
- {
- get { return DataContract.Details ; }
-
-
- }
-
- public string Hinweise
- {
- get { return DataContract.Hinweise; }
-
-
- }
-
- public bool NeuErstellen
- {
- get { return _NeuErstellen; }
-
- set
- {
- if (AreDifferent(_NeuErstellen, value))
- {
- _NeuErstellen = value;
- StoreDirtyInformation(AreDifferent(DataContract.NeuErstellen, value), PropertyName_NeuErstellen);
- FirePropertyChanged(PropertyName_NeuErstellen);
- }
- }
- }
-
- public bool DiffErstellen
- {
- get { return _DiffErstellen; }
-
- set
- {
- if (AreDifferent(_DiffErstellen, value))
- {
- _DiffErstellen = value;
- StoreDirtyInformation(AreDifferent(DataContract.DiffErstellen, value), PropertyName_DiffErstellen);
- FirePropertyChanged(PropertyName_DiffErstellen);
- }
- }
- }
-
- public bool IsReviewed
- {
- get { return _IsReviewed; }
-
- set
- {
- if (AreDifferent(_IsReviewed, value))
- {
- _IsReviewed = value;
- StoreDirtyInformation(AreDifferent(DataContract.IsReviewed, value), PropertyName_IsReviewed);
- FirePropertyChanged(PropertyName_IsReviewed);
- }
- }
- }
-
- public bool IsSent
- {
- get { return _IsSent; }
-
- set
- {
- if (AreDifferent(_IsSent, value))
- {
- _IsSent = value;
- StoreDirtyInformation(AreDifferent(DataContract.IsSent, value), PropertyName_IsSent);
- FirePropertyChanged(PropertyName_IsSent);
- }
- }
- }
-
- public bool IsExported
- {
- get { return _IsExported; }
-
- set
- {
- if (AreDifferent(_IsExported, value))
- {
- _IsExported = value;
- StoreDirtyInformation(AreDifferent(DataContract.IsExported, value), PropertyName_IsExported);
- FirePropertyChanged(PropertyName_IsExported);
- }
- }
- }
-
-
- public bool IsPaid
- {
- get { return _IsPaid; }
-
- set
- {
- if (AreDifferent(_IsPaid, value))
- {
- _IsPaid = value;
- StoreDirtyInformation(AreDifferent(DataContract.IsPaid, value), PropertyName_IsPaid);
- FirePropertyChanged(PropertyName_IsPaid);
- }
- }
- }
-
- public string Notice
- {
- get { return _Notice; }
-
- set
- {
- if (AreDifferent(_Notice, value))
- {
- _Notice = value;
- StoreDirtyInformation(AreDifferent(DataContract.Notice, value), PropertyName_Notice);
- FirePropertyChanged(PropertyName_Notice);
- }
- }
- }
-
- public string PartialPayment
- {
- get { return _PartialPayment; }
-
- set
- {
- if (AreDifferent(_PartialPayment, value))
- {
- _PartialPayment = value;
- StoreDirtyInformation(AreDifferent(DataContract.PartialPayment, value), PropertyName_PartialPayment);
- FirePropertyChanged(PropertyName_PartialPayment);
- }
- }
- }
-
- public long? RecipientCostBearerOid
- {
- get { return _RecipientCostBearerOid; }
-
- set
- {
- if (AreDifferent(_RecipientCostBearerOid, value))
- {
- _RecipientCostBearerOid = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientCostBearerOid, value), PropertyName_RecipientCostBearerOid);
- FirePropertyChanged(PropertyName_RecipientCostBearerOid);
- }
- }
- }
-
- public long? RecipientCustomerOid
- {
- get { return _RecipientCustomerOid; }
-
- set
- {
- if (AreDifferent(_RecipientCustomerOid, value))
- {
- _RecipientCustomerOid = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientCustomerOid, value), PropertyName_RecipientCustomerOid);
- FirePropertyChanged(PropertyName_RecipientCustomerOid);
- }
- }
- }
-
- public string RecipientDivision
- {
- get { return _RecipientDivision; }
-
- set
- {
- if (AreDifferent(_RecipientDivision, value))
- {
- _RecipientDivision = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientDivision, value), PropertyName_RecipientDivision);
- FirePropertyChanged(PropertyName_RecipientDivision);
- }
- }
- }
-
- public string RecipientOrganisation
- {
- get { return _RecipientOrganisation; }
-
- set
- {
- if (AreDifferent(_RecipientOrganisation, value))
- {
- _RecipientOrganisation = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientOrganisation, value), PropertyName_RecipientOrganisation);
- FirePropertyChanged(PropertyName_RecipientOrganisation);
- }
- }
- }
-
- public long? RecipientOrganisationOid
- {
- get { return _RecipientOrganisationOid; }
-
- set
- {
- if (AreDifferent(_RecipientOrganisationOid, value))
- {
- _RecipientOrganisationOid = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientOrganisationOid, value), PropertyName_RecipientOrganisationOid);
- FirePropertyChanged(PropertyName_RecipientOrganisationOid);
- }
- }
- }
-
- public String RecipientPostBox
- {
- get { return _RecipientPostBox; }
-
- set
- {
- if (AreDifferent(_RecipientPostBox, value))
- {
- _RecipientPostBox = value;
-
-
- StoreDirtyInformation(
- DataContract.RecipientContactInformations.SingleOrDefault(con => con.ContactType == ContactType.business_POBox && con.ContactValue == value) == null,
- PropertyName_RecipientPostBox);
-
- FirePropertyChanged(PropertyName_RecipientPostBox);
- }
- }
- }
-
- public string RecipientPersonFirstName
- {
- get { return _RecipientPersonFirstName; }
-
- set
- {
- if (AreDifferent(_RecipientPersonFirstName, value))
- {
- _RecipientPersonFirstName = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientPersonFirstName, value), PropertyName_RecipientPersonFirstName);
- FirePropertyChanged(PropertyName_RecipientPersonFirstName);
- }
- }
- }
-
- public string RecipientPersonLastName
- {
- get { return _RecipientPersonLastName; }
-
- set
- {
- if (AreDifferent(_RecipientPersonLastName, value))
- {
- _RecipientPersonLastName = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientPersonLastName, value), PropertyName_RecipientPersonLastName);
- FirePropertyChanged(PropertyName_RecipientPersonLastName);
- }
- }
- }
-
- public long? RecipientPersonOid
- {
- get { return _RecipientPersonOid; }
-
- set
- {
- if (AreDifferent(_RecipientPersonOid, value))
- {
- _RecipientPersonOid = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientPersonOid, value), PropertyName_RecipientPersonOid);
- FirePropertyChanged(PropertyName_RecipientPersonOid);
- }
- }
- }
-
- public string RecipientPostCode
- {
- get { return _RecipientPostCode; }
-
- set
- {
- if (AreDifferent(_RecipientPostCode, value))
- {
- _RecipientPostCode = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientPostCode, value), PropertyName_RecipientPostCode);
- FirePropertyChanged(PropertyName_RecipientPostCode);
- }
- }
- }
-
- public string RecipientAddressLine1
- {
- get { return _RecipientAddressLine1; }
-
- set
- {
- if (AreDifferent(_RecipientAddressLine1, value))
- {
- _RecipientAddressLine1 = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientAddressLine1, value), PropertyName_RecipientAddressLine1);
- FirePropertyChanged(PropertyName_RecipientAddressLine1);
- }
- }
- }
-
- public string RecipientStreet
- {
- get { return _RecipientStreet; }
-
- set
- {
- if (AreDifferent(_RecipientStreet, value))
- {
- _RecipientStreet = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientStreet, value), PropertyName_RecipientStreet);
- FirePropertyChanged(PropertyName_RecipientStreet);
- }
- }
- }
-
- public string RecipientString
- {
- get
- {
- string result = _RecipientOrganisation;
- if (!string.IsNullOrEmpty(result) && (!string.IsNullOrEmpty(_RecipientPersonFirstName) || !string.IsNullOrEmpty(_RecipientPersonLastName)))
- {
- result += " - ";
- }
-
- result += _RecipientPersonFirstName + " " + _RecipientPersonLastName;
- return result;
- }
-
- set { }
- }
-
- public string RecipientTown
- {
- get { return _RecipientTown; }
-
- set
- {
- if (AreDifferent(_RecipientTown, value))
- {
- _RecipientTown = value;
- StoreDirtyInformation(AreDifferent(DataContract.RecipientTown, value), PropertyName_RecipientTown);
- FirePropertyChanged(PropertyName_RecipientTown);
- }
- }
- }
-
- public string ReportLink
- {
- get
- {
- string url = string.Empty;
-
- switch (DataContract.Type)
- {
- case InvoiceType.CustomerEquity:
- url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?ioid=" + DataContract.InvoiceBaseOid + "&type=CustomerInvoice";
- break;
- case InvoiceType.General:
- url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?ioid=" + DataContract.InvoiceBaseOid + "&type=CustomerInvoice";
- break;
- case InvoiceType.Settlement:
- url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?ibid=" + DataContract.InvoiceBaseOid + "&type=" + Utils.EnumName(ReportTypes.Settlement);
- break;
- case InvoiceType.Service:
- url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?ibid=" + DataContract.InvoiceBaseOid + "&type=" + Utils.EnumName(ReportTypes.ServiceInvoice);
- break;
- default:
- url = string.Empty;
- break;
- }
-
- return url;
- }
- }
-
- public string SenderDivision
- {
- get { return _SenderDivision; }
-
- set
- {
- if (AreDifferent(_SenderDivision, value))
- {
- _SenderDivision = value;
- StoreDirtyInformation(AreDifferent(DataContract.SenderDivision, value), PropertyName_SenderDivision);
- FirePropertyChanged(PropertyName_SenderDivision);
- }
- }
- }
-
- public string SenderFax
- {
- get { return _SenderFax; }
-
- set
- {
- if (AreDifferent(_SenderFax, value))
- {
- _SenderFax = value;
-
- StoreDirtyInformation(
- DataContract.SenderContactInformations.SingleOrDefault(con => con.ContactType == ContactType.business_Fax && con.ContactValue == value) == null,
- PropertyName_SenderFax);
-
- FirePropertyChanged(PropertyName_SenderFax);
- }
- }
- }
-
- public string SenderFirstName
- {
- get { return _SenderFirstName; }
-
- set
- {
- if (AreDifferent(_SenderFirstName, value))
- {
- _SenderFirstName = value;
- StoreDirtyInformation(AreDifferent(DataContract.SenderFirstName, value), PropertyName_SenderFirstName);
- FirePropertyChanged(PropertyName_SenderFirstName);
- }
- }
- }
-
- public string SenderLastName
- {
- get { return _SenderLastName; }
-
- set
- {
- if (AreDifferent(_SenderLastName, value))
- {
- _SenderLastName = value;
- StoreDirtyInformation(AreDifferent(DataContract.SenderLastName, value), PropertyName_SenderLastName);
- FirePropertyChanged(PropertyName_SenderLastName);
- }
- }
- }
-
- public string SenderOrganisation
- {
- get { return _SenderOrganisation; }
-
- set
- {
- if (AreDifferent(_SenderOrganisation, value))
- {
- _SenderOrganisation = value;
- StoreDirtyInformation(AreDifferent(DataContract.SenderOrganisation, value), PropertyName_SenderOrganisation);
- FirePropertyChanged(PropertyName_SenderOrganisation);
- }
- }
- }
-
- public string SenderPhone
- {
- get { return _SenderPhone; }
-
- set
- {
- if (AreDifferent(_SenderPhone, value))
- {
- _SenderPhone = value;
-
- StoreDirtyInformation(
- DataContract.SenderContactInformations.Where(con => con.ContactType == ContactType.business_Phone && con.ContactValue == value).SingleOrDefault() == null,
- PropertyName_SenderPhone);
-
- FirePropertyChanged(PropertyName_SenderPhone);
- }
- }
- }
-
- public long? SupportConceptOid
- {
- get { return _SupportConceptOid; }
-
- set
- {
- if (AreDifferent(_SupportConceptOid, value))
- {
- _SupportConceptOid = value;
- StoreDirtyInformation(AreDifferent(DataContract.SupportConceptOid, value), PropertyName_SupportConceptOid);
- FirePropertyChanged(PropertyName_SupportConceptOid);
- }
- }
- }
-
- public decimal? TotalAmount
- {
- get { return _TotalAmount; }
-
- set
- {
- if (AreDifferent(_TotalAmount, value))
- {
- _TotalAmount = value;
- StoreDirtyInformation(AreDifferent(DataContract.TotalAmount, value), PropertyName_TotalAmount);
- FirePropertyChanged(PropertyName_TotalAmount);
- }
- }
- }
-
- public string TypeString
- {
- get
- {
- if (!String.IsNullOrEmpty(DataContract.InvoiceTypeText))
- {
- return DataContract.InvoiceTypeText;
- }
- return _TypeTranslation[DataContract.Type];
- }
- }
-
- public String BackgroundColor
- {
- get; set;
- }
-
- #endregion
-
- #region Methods
-
- protected override void InitByDataContract(InvoiceBaseDC pDataContract)
- {
- _SupportConceptOid = pDataContract.SupportConceptOid;
- _SenderOrganisation = pDataContract.SenderOrganisation;
- _SenderLastName = pDataContract.SenderLastName;
- _SenderFirstName = pDataContract.SenderFirstName;
- _SenderDivision = pDataContract.SenderDivision;
- _RecipientPersonOid = pDataContract.RecipientPersonOid;
- _RecipientPersonLastName = pDataContract.RecipientPersonLastName;
- _RecipientPersonFirstName = pDataContract.RecipientPersonFirstName;
- _RecipientOrganisationOid = pDataContract.RecipientOrganisationOid;
- _RecipientOrganisation = pDataContract.RecipientOrganisation;
- _RecipientDivision = pDataContract.RecipientDivision;
- _RecipientCustomerOid = pDataContract.RecipientCustomerOid;
- _RecipientCostBearerOid = pDataContract.RecipientCostBearerOid;
- _RecipientStreet = pDataContract.RecipientStreet;
- _RecipientAddressLine1 = pDataContract.RecipientAddressLine1;
- _RecipientTown = pDataContract.RecipientTown;
- _RecipientPostCode = pDataContract.RecipientPostCode;
- _IsReviewed = pDataContract.IsReviewed;
- _IsSent = pDataContract.IsSent;
- _IsExported = pDataContract.IsExported;
- _IsPaid = pDataContract.IsPaid;
- _PartialPayment = pDataContract.PartialPayment;
- _NeuErstellen = pDataContract.NeuErstellen;
- _DiffErstellen = pDataContract.DiffErstellen;
- _InvoiceTitle = pDataContract.InvoiceTitle;
- _InvoiceNumber = pDataContract.InvoiceNumber;
- _InvoiceDate = pDataContract.InvoiceDate;
- _DueDate = pDataContract.DueDate;
- _CreatorLastName = pDataContract.CreatorLastName;
- _CreatorFirstName = pDataContract.CreatorFirstName;
- _AccountingPeriodEnd = pDataContract.AccountingPeriodEnd;
- _AccountingPeriodStart = pDataContract.AccountingPeriodStart;
- _Notice = pDataContract.Notice;
- _DunningLetterCount = pDataContract.DunningLetterCount;
- _TotalAmount = pDataContract.TotalAmount;
- _CustomerReferenceNumber = pDataContract.CustomerReferenceNumber;
- BackgroundColor = pDataContract.BackgroundColor;
-
- foreach (var iContactDC in pDataContract.SenderContactInformations)
- {
- if (iContactDC.ContactType == ContactType.business_Fax)
- {
- _SenderFax = iContactDC.ContactValue;
- }
-
- if (iContactDC.ContactType == ContactType.business_Phone)
- {
- _SenderPhone = iContactDC.ContactValue;
- }
- }
-
- foreach (var iContactDC in pDataContract.RecipientContactInformations)
- {
- if (iContactDC.ContactType == ContactType.business_POBox)
- {
- _RecipientPostBox = iContactDC.ContactValue;
- }
- }
-
- _InvoiceItems = new InvoiceItemListVM(pDataContract.InvoiceItems);
- }
-
- protected override InvoiceBaseDC MapToDataContract(InvoiceBaseDC pDataContract, bool doCommit)
- {
- pDataContract.SupportConceptOid = _SupportConceptOid;
- pDataContract.SenderOrganisation = _SenderOrganisation;
- pDataContract.SenderLastName = _SenderLastName;
- pDataContract.SenderFirstName = _SenderFirstName;
- pDataContract.SenderDivision = _SenderDivision;
- pDataContract.RecipientPersonOid = _RecipientPersonOid;
- pDataContract.RecipientPersonLastName = _RecipientPersonLastName;
- pDataContract.RecipientPersonFirstName = _RecipientPersonFirstName;
- pDataContract.RecipientOrganisationOid = _RecipientOrganisationOid;
- pDataContract.RecipientOrganisation = _RecipientOrganisation;
- pDataContract.RecipientDivision = _RecipientDivision;
- pDataContract.RecipientCustomerOid = _RecipientCustomerOid;
- pDataContract.RecipientCostBearerOid = _RecipientCostBearerOid;
- pDataContract.RecipientPostCode = _RecipientPostCode;
- pDataContract.RecipientStreet = _RecipientStreet;
- pDataContract.RecipientAddressLine1 = _RecipientAddressLine1;
- pDataContract.RecipientTown = _RecipientTown;
- pDataContract.IsReviewed = _IsReviewed;
- pDataContract.IsSent = _IsSent;
- pDataContract.IsExported = _IsExported;
- pDataContract.IsPaid = _IsPaid;
- pDataContract.PartialPayment = _PartialPayment;
- pDataContract.NeuErstellen = _NeuErstellen;
- pDataContract.DiffErstellen = _DiffErstellen;
- pDataContract.InvoiceTitle = _InvoiceTitle;
- pDataContract.InvoiceNumber = _InvoiceNumber;
- pDataContract.InvoiceDate = _InvoiceDate;
- pDataContract.DueDate = _DueDate;
- pDataContract.CreatorLastName = _CreatorLastName;
- pDataContract.CreatorFirstName = _CreatorFirstName;
- pDataContract.AccountingPeriodEnd = _AccountingPeriodEnd;
- pDataContract.AccountingPeriodStart = _AccountingPeriodStart;
- pDataContract.Notice = _Notice;
- pDataContract.DunningLetterCount = _DunningLetterCount;
- pDataContract.TotalAmount = _TotalAmount;
- pDataContract.CustomerReferenceNumber = _CustomerReferenceNumber;
-
- CommitSenderContact(_SenderFax, ContactType.business_Fax);
- CommitSenderContact(_SenderPhone, ContactType.business_Phone);
- CommitReceiverContact(_RecipientPostBox, ContactType.business_POBox);
-
- pDataContract.InvoiceItems = _InvoiceItems.CopyToDCList(doCommit);
-
- return pDataContract;
- }
-
- private void CommitSenderContact(string pValue, ContactType pContactType)
- {
- var lOldContactDCs = DataContract.SenderContactInformations != null ? DataContract.SenderContactInformations.ToList() : new List();
- CommitContact(pValue, pContactType, lOldContactDCs);
-
- DataContract.SenderContactInformations = lOldContactDCs;
- }
-
-
- private void CommitReceiverContact(string pValue, ContactType pContactType)
- {
- var lOldContactDCs = DataContract.RecipientContactInformations != null ? DataContract.RecipientContactInformations.ToList() : new List();
- CommitContact(pValue, pContactType, lOldContactDCs);
-
- DataContract.RecipientContactInformations = lOldContactDCs;
- }
-
- private void CommitContact(string pValue, ContactType pContactType, List lOldContactDCs)
- {
- var lContactDC = lOldContactDCs.SingleOrDefault(con => con.ContactType == pContactType);
-
- if (string.IsNullOrEmpty(pValue) && lContactDC != null)
- {
- lOldContactDCs.Remove(lContactDC);
- }
- else if (!string.IsNullOrEmpty(pValue))
- {
- if (lContactDC == null)
- {
- lContactDC = new ContactDC
- {
- ContactType = pContactType
- };
-
- lOldContactDCs.Add(lContactDC);
- }
-
- lContactDC.ContactValue = pValue;
- }
- }
-
- #endregion
- }
+ set
+ {
+ if (AreDifferent(_AccountingPeriodStart, value))
+ {
+ _AccountingPeriodStart = value;
+ StoreDirtyInformation(AreDifferent(DataContract.AccountingPeriodStart, value), PropertyName_AccountingPeriodStart);
+ FirePropertyChanged(PropertyName_AccountingPeriodStart);
+ }
+ }
+ }
+
+ public string AccountingPeriodString
+ {
+ get
+ {
+ return _AccountingPeriodEnd.HasValue && _AccountingPeriodStart.HasValue
+ ? _AccountingPeriodStart.Value.ToShortDateString() + " - " + _AccountingPeriodEnd.Value.ToShortDateString()
+ : string.Empty;
+ }
+
+ set { }
+ }
+
+ public string CreatorFirstName
+ {
+ get { return _CreatorFirstName; }
+
+ set
+ {
+ if (AreDifferent(_CreatorFirstName, value))
+ {
+ _CreatorFirstName = value;
+ StoreDirtyInformation(AreDifferent(DataContract.CreatorFirstName, value), PropertyName_CreatorFirstName);
+ FirePropertyChanged(PropertyName_CreatorFirstName);
+ }
+ }
+ }
+
+ public string CreatorLastName
+ {
+ get { return _CreatorLastName; }
+
+ set
+ {
+ if (AreDifferent(_CreatorLastName, value))
+ {
+ _CreatorLastName = value;
+ StoreDirtyInformation(AreDifferent(DataContract.CreatorLastName, value), PropertyName_CreatorLastName);
+ FirePropertyChanged(PropertyName_CreatorLastName);
+ }
+ }
+ }
+
+ public string CustomerName
+ {
+ get
+ {
+ string result = string.Empty;
+ if (!String.IsNullOrEmpty(DataContract.CustomerLastName))
+ {
+ result = DataContract.CustomerLastName;
+ }
+
+ if (!String.IsNullOrEmpty(DataContract.CustomerFirstName))
+ {
+ if (result.Length > 0)
+ {
+ result += ", ";
+ }
+
+ result += DataContract.CustomerFirstName;
+ }
+
+ return result;
+ }
+
+ set { }
+ }
+
+ public string CustomerReferenceNumber
+ {
+ get { return _CustomerReferenceNumber; }
+
+ set
+ {
+ if (AreDifferent(_CustomerReferenceNumber, value))
+ {
+ _CustomerReferenceNumber = value;
+ StoreDirtyInformation(AreDifferent(DataContract.CustomerReferenceNumber, value), PropertyName_CustomerReferenceNumber);
+ FirePropertyChanged(PropertyName_CustomerReferenceNumber);
+ }
+ }
+ }
+
+ public DateTime? DueDate
+ {
+ get { return _DueDate; }
+
+ set
+ {
+ if (AreDifferent(_DueDate, value))
+ {
+ _DueDate = value;
+ StoreDirtyInformation(AreDifferent(DataContract.DueDate, value), PropertyName_DueDate);
+ FirePropertyChanged(PropertyName_DueDate);
+ }
+ }
+ }
+
+ public int? DunningLetterCount
+ {
+ get { return _DunningLetterCount; }
+
+ set
+ {
+ if (AreDifferent(_DunningLetterCount, value))
+ {
+ _DunningLetterCount = value;
+ StoreDirtyInformation(AreDifferent(DataContract.DunningLetterCount, value), PropertyName_DunningLetterCount);
+ FirePropertyChanged(PropertyName_DunningLetterCount);
+ }
+ }
+ }
+
+ [Validation(ValidationRule = ValidationRules.NotNullOrStringEmpty)]
+ public DateTime? InvoiceDate
+ {
+ get { return _InvoiceDate; }
+
+ set
+ {
+ if (AreDifferent(_InvoiceDate, value))
+ {
+ _InvoiceDate = value;
+ StoreDirtyInformation(AreDifferent(DataContract.InvoiceDate, value), PropertyName_InvoiceDate);
+ FirePropertyChanged(PropertyName_InvoiceDate);
+ }
+ }
+ }
+
+ public InvoiceItemListVM InvoiceItems
+ {
+ get { return _InvoiceItems; }
+
+ set
+ {
+ if (AreDifferent(_InvoiceItems, value))
+ {
+ _InvoiceItems = value;
+ FirePropertyChanged(PropertyName_InvoiceItems);
+ }
+ }
+ }
+
+ public string InvoiceNumber
+ {
+ get { return _InvoiceNumber; }
+
+ set
+ {
+ if (AreDifferent(_InvoiceNumber, value))
+ {
+ _InvoiceNumber = value;
+ StoreDirtyInformation(AreDifferent(DataContract.InvoiceNumber, value), PropertyName_InvoiceNumber);
+ FirePropertyChanged(PropertyName_InvoiceNumber);
+ }
+ }
+ }
+
+ public string InvoiceTitle
+ {
+ get { return _InvoiceTitle; }
+
+ set
+ {
+ if (AreDifferent(_InvoiceTitle, value))
+ {
+ _InvoiceTitle = value;
+ StoreDirtyInformation(AreDifferent(DataContract.InvoiceTitle, value), PropertyName_InvoiceTitle);
+ FirePropertyChanged(PropertyName_InvoiceTitle);
+ }
+ }
+ }
+
+ public string Details
+ {
+ get { return DataContract.Details; }
+
+
+ }
+
+ public string Hinweise
+ {
+ get { return DataContract.Hinweise; }
+
+
+ }
+
+ public bool NeuErstellen
+ {
+ get { return _NeuErstellen; }
+
+ set
+ {
+ if (AreDifferent(_NeuErstellen, value))
+ {
+ _NeuErstellen = value;
+ StoreDirtyInformation(AreDifferent(DataContract.NeuErstellen, value), PropertyName_NeuErstellen);
+ FirePropertyChanged(PropertyName_NeuErstellen);
+ }
+ }
+ }
+
+ public bool DiffErstellen
+ {
+ get { return _DiffErstellen; }
+
+ set
+ {
+ if (AreDifferent(_DiffErstellen, value))
+ {
+ _DiffErstellen = value;
+ StoreDirtyInformation(AreDifferent(DataContract.DiffErstellen, value), PropertyName_DiffErstellen);
+ FirePropertyChanged(PropertyName_DiffErstellen);
+ }
+ }
+ }
+
+ public bool IsReviewed
+ {
+ get { return _IsReviewed; }
+
+ set
+ {
+ if (AreDifferent(_IsReviewed, value))
+ {
+ _IsReviewed = value;
+ StoreDirtyInformation(AreDifferent(DataContract.IsReviewed, value), PropertyName_IsReviewed);
+ FirePropertyChanged(PropertyName_IsReviewed);
+ }
+ }
+ }
+
+ public bool IsSent
+ {
+ get { return _IsSent; }
+
+ set
+ {
+ if (AreDifferent(_IsSent, value))
+ {
+ _IsSent = value;
+ StoreDirtyInformation(AreDifferent(DataContract.IsSent, value), PropertyName_IsSent);
+ FirePropertyChanged(PropertyName_IsSent);
+ }
+ }
+ }
+
+ public bool IsExported
+ {
+ get { return _IsExported; }
+
+ set
+ {
+ if (AreDifferent(_IsExported, value))
+ {
+ _IsExported = value;
+ StoreDirtyInformation(AreDifferent(DataContract.IsExported, value), PropertyName_IsExported);
+ FirePropertyChanged(PropertyName_IsExported);
+ }
+ }
+ }
+
+
+ public bool IsPaid
+ {
+ get { return _IsPaid; }
+
+ set
+ {
+ if (AreDifferent(_IsPaid, value))
+ {
+ _IsPaid = value;
+ StoreDirtyInformation(AreDifferent(DataContract.IsPaid, value), PropertyName_IsPaid);
+ FirePropertyChanged(PropertyName_IsPaid);
+ }
+ }
+ }
+
+ public string Notice
+ {
+ get { return _Notice; }
+
+ set
+ {
+ if (AreDifferent(_Notice, value))
+ {
+ _Notice = value;
+ StoreDirtyInformation(AreDifferent(DataContract.Notice, value), PropertyName_Notice);
+ FirePropertyChanged(PropertyName_Notice);
+ }
+ }
+ }
+
+ public string PartialPayment
+ {
+ get { return _PartialPayment; }
+
+ set
+ {
+ if (AreDifferent(_PartialPayment, value))
+ {
+ _PartialPayment = value;
+ StoreDirtyInformation(AreDifferent(DataContract.PartialPayment, value), PropertyName_PartialPayment);
+ FirePropertyChanged(PropertyName_PartialPayment);
+ }
+ }
+ }
+
+ public long? RecipientCostBearerOid
+ {
+ get { return _RecipientCostBearerOid; }
+
+ set
+ {
+ if (AreDifferent(_RecipientCostBearerOid, value))
+ {
+ _RecipientCostBearerOid = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientCostBearerOid, value), PropertyName_RecipientCostBearerOid);
+ FirePropertyChanged(PropertyName_RecipientCostBearerOid);
+ }
+ }
+ }
+
+ public long? RecipientCustomerOid
+ {
+ get { return _RecipientCustomerOid; }
+
+ set
+ {
+ if (AreDifferent(_RecipientCustomerOid, value))
+ {
+ _RecipientCustomerOid = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientCustomerOid, value), PropertyName_RecipientCustomerOid);
+ FirePropertyChanged(PropertyName_RecipientCustomerOid);
+ }
+ }
+ }
+
+ public string RecipientDivision
+ {
+ get { return _RecipientDivision; }
+
+ set
+ {
+ if (AreDifferent(_RecipientDivision, value))
+ {
+ _RecipientDivision = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientDivision, value), PropertyName_RecipientDivision);
+ FirePropertyChanged(PropertyName_RecipientDivision);
+ }
+ }
+ }
+
+ public string RecipientOrganisation
+ {
+ get { return _RecipientOrganisation; }
+
+ set
+ {
+ if (AreDifferent(_RecipientOrganisation, value))
+ {
+ _RecipientOrganisation = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientOrganisation, value), PropertyName_RecipientOrganisation);
+ FirePropertyChanged(PropertyName_RecipientOrganisation);
+ }
+ }
+ }
+
+ public long? RecipientOrganisationOid
+ {
+ get { return _RecipientOrganisationOid; }
+
+ set
+ {
+ if (AreDifferent(_RecipientOrganisationOid, value))
+ {
+ _RecipientOrganisationOid = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientOrganisationOid, value), PropertyName_RecipientOrganisationOid);
+ FirePropertyChanged(PropertyName_RecipientOrganisationOid);
+ }
+ }
+ }
+
+ public String RecipientPostBox
+ {
+ get { return _RecipientPostBox; }
+
+ set
+ {
+ if (AreDifferent(_RecipientPostBox, value))
+ {
+ _RecipientPostBox = value;
+
+
+ StoreDirtyInformation(
+ DataContract.RecipientContactInformations.SingleOrDefault(con => con.ContactType == ContactType.business_POBox && con.ContactValue == value) == null,
+ PropertyName_RecipientPostBox);
+
+ FirePropertyChanged(PropertyName_RecipientPostBox);
+ }
+ }
+ }
+
+ public string RecipientPersonFirstName
+ {
+ get { return _RecipientPersonFirstName; }
+
+ set
+ {
+ if (AreDifferent(_RecipientPersonFirstName, value))
+ {
+ _RecipientPersonFirstName = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientPersonFirstName, value), PropertyName_RecipientPersonFirstName);
+ FirePropertyChanged(PropertyName_RecipientPersonFirstName);
+ }
+ }
+ }
+
+ public string RecipientPersonLastName
+ {
+ get { return _RecipientPersonLastName; }
+
+ set
+ {
+ if (AreDifferent(_RecipientPersonLastName, value))
+ {
+ _RecipientPersonLastName = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientPersonLastName, value), PropertyName_RecipientPersonLastName);
+ FirePropertyChanged(PropertyName_RecipientPersonLastName);
+ }
+ }
+ }
+
+ public long? RecipientPersonOid
+ {
+ get { return _RecipientPersonOid; }
+
+ set
+ {
+ if (AreDifferent(_RecipientPersonOid, value))
+ {
+ _RecipientPersonOid = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientPersonOid, value), PropertyName_RecipientPersonOid);
+ FirePropertyChanged(PropertyName_RecipientPersonOid);
+ }
+ }
+ }
+
+ public string RecipientPostCode
+ {
+ get { return _RecipientPostCode; }
+
+ set
+ {
+ if (AreDifferent(_RecipientPostCode, value))
+ {
+ _RecipientPostCode = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientPostCode, value), PropertyName_RecipientPostCode);
+ FirePropertyChanged(PropertyName_RecipientPostCode);
+ }
+ }
+ }
+
+ public string RecipientAddressLine1
+ {
+ get { return _RecipientAddressLine1; }
+
+ set
+ {
+ if (AreDifferent(_RecipientAddressLine1, value))
+ {
+ _RecipientAddressLine1 = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientAddressLine1, value), PropertyName_RecipientAddressLine1);
+ FirePropertyChanged(PropertyName_RecipientAddressLine1);
+ }
+ }
+ }
+
+ public string RecipientStreet
+ {
+ get { return _RecipientStreet; }
+
+ set
+ {
+ if (AreDifferent(_RecipientStreet, value))
+ {
+ _RecipientStreet = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientStreet, value), PropertyName_RecipientStreet);
+ FirePropertyChanged(PropertyName_RecipientStreet);
+ }
+ }
+ }
+
+ public string RecipientString
+ {
+ get
+ {
+ string result = _RecipientOrganisation;
+ if (!string.IsNullOrEmpty(result) && (!string.IsNullOrEmpty(_RecipientPersonFirstName) || !string.IsNullOrEmpty(_RecipientPersonLastName)))
+ {
+ result += " - ";
+ }
+
+ result += _RecipientPersonFirstName + " " + _RecipientPersonLastName;
+ return result;
+ }
+
+ set { }
+ }
+
+ public string RecipientTown
+ {
+ get { return _RecipientTown; }
+
+ set
+ {
+ if (AreDifferent(_RecipientTown, value))
+ {
+ _RecipientTown = value;
+ StoreDirtyInformation(AreDifferent(DataContract.RecipientTown, value), PropertyName_RecipientTown);
+ FirePropertyChanged(PropertyName_RecipientTown);
+ }
+ }
+ }
+
+ public string ReportLink
+ {
+ get
+ {
+ string url = string.Empty;
+
+ switch (DataContract.Type)
+ {
+ case InvoiceType.CustomerEquity:
+ url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?ioid=" + DataContract.InvoiceBaseOid + "&type=CustomerInvoice";
+ break;
+ case InvoiceType.General:
+ url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?ioid=" + DataContract.InvoiceBaseOid + "&type=CustomerInvoice";
+ break;
+ case InvoiceType.Settlement:
+ url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?ibid=" + DataContract.InvoiceBaseOid + "&type=" + Utils.EnumName(ReportTypes.Settlement);
+ break;
+ case InvoiceType.Service:
+ url = BeWoApp.SiteOfOrigin + "/ReportView.aspx?ibid=" + DataContract.InvoiceBaseOid + "&type=" + Utils.EnumName(ReportTypes.ServiceInvoice);
+ break;
+ default:
+ url = string.Empty;
+ break;
+ }
+
+ return url;
+ }
+ }
+
+ public string SenderDivision
+ {
+ get { return _SenderDivision; }
+
+ set
+ {
+ if (AreDifferent(_SenderDivision, value))
+ {
+ _SenderDivision = value;
+ StoreDirtyInformation(AreDifferent(DataContract.SenderDivision, value), PropertyName_SenderDivision);
+ FirePropertyChanged(PropertyName_SenderDivision);
+ }
+ }
+ }
+
+ public string SenderFax
+ {
+ get { return _SenderFax; }
+
+ set
+ {
+ if (AreDifferent(_SenderFax, value))
+ {
+ _SenderFax = value;
+
+ StoreDirtyInformation(
+ DataContract.SenderContactInformations.SingleOrDefault(con => con.ContactType == ContactType.business_Fax && con.ContactValue == value) == null,
+ PropertyName_SenderFax);
+
+ FirePropertyChanged(PropertyName_SenderFax);
+ }
+ }
+ }
+
+ public string SenderFirstName
+ {
+ get { return _SenderFirstName; }
+
+ set
+ {
+ if (AreDifferent(_SenderFirstName, value))
+ {
+ _SenderFirstName = value;
+ StoreDirtyInformation(AreDifferent(DataContract.SenderFirstName, value), PropertyName_SenderFirstName);
+ FirePropertyChanged(PropertyName_SenderFirstName);
+ }
+ }
+ }
+
+ public string SenderLastName
+ {
+ get { return _SenderLastName; }
+
+ set
+ {
+ if (AreDifferent(_SenderLastName, value))
+ {
+ _SenderLastName = value;
+ StoreDirtyInformation(AreDifferent(DataContract.SenderLastName, value), PropertyName_SenderLastName);
+ FirePropertyChanged(PropertyName_SenderLastName);
+ }
+ }
+ }
+
+ public string SenderOrganisation
+ {
+ get { return _SenderOrganisation; }
+
+ set
+ {
+ if (AreDifferent(_SenderOrganisation, value))
+ {
+ _SenderOrganisation = value;
+ StoreDirtyInformation(AreDifferent(DataContract.SenderOrganisation, value), PropertyName_SenderOrganisation);
+ FirePropertyChanged(PropertyName_SenderOrganisation);
+ }
+ }
+ }
+
+ public string SenderPhone
+ {
+ get { return _SenderPhone; }
+
+ set
+ {
+ if (AreDifferent(_SenderPhone, value))
+ {
+ _SenderPhone = value;
+
+ StoreDirtyInformation(
+ DataContract.SenderContactInformations.Where(con => con.ContactType == ContactType.business_Phone && con.ContactValue == value).SingleOrDefault() == null,
+ PropertyName_SenderPhone);
+
+ FirePropertyChanged(PropertyName_SenderPhone);
+ }
+ }
+ }
+
+ public long? SupportConceptOid
+ {
+ get { return _SupportConceptOid; }
+
+ set
+ {
+ if (AreDifferent(_SupportConceptOid, value))
+ {
+ _SupportConceptOid = value;
+ StoreDirtyInformation(AreDifferent(DataContract.SupportConceptOid, value), PropertyName_SupportConceptOid);
+ FirePropertyChanged(PropertyName_SupportConceptOid);
+ }
+ }
+ }
+
+ public decimal? TotalAmount
+ {
+ get { return _TotalAmount; }
+
+ set
+ {
+ if (AreDifferent(_TotalAmount, value))
+ {
+ _TotalAmount = value;
+ StoreDirtyInformation(AreDifferent(DataContract.TotalAmount, value), PropertyName_TotalAmount);
+ FirePropertyChanged(PropertyName_TotalAmount);
+ }
+ }
+ }
+
+ public string TypeString
+ {
+ get
+ {
+ if (!String.IsNullOrEmpty(DataContract.InvoiceTypeText))
+ {
+ return DataContract.InvoiceTypeText;
+ }
+ return _TypeTranslation[DataContract.Type];
+ }
+ }
+
+ public String BackgroundColor
+ {
+ get; set;
+ }
+
+ protected override void InitByDataContract(InvoiceBaseDC pDataContract)
+ {
+ _SupportConceptOid = pDataContract.SupportConceptOid;
+ _SenderOrganisation = pDataContract.SenderOrganisation;
+ _SenderLastName = pDataContract.SenderLastName;
+ _SenderFirstName = pDataContract.SenderFirstName;
+ _SenderDivision = pDataContract.SenderDivision;
+ _RecipientPersonOid = pDataContract.RecipientPersonOid;
+ _RecipientPersonLastName = pDataContract.RecipientPersonLastName;
+ _RecipientPersonFirstName = pDataContract.RecipientPersonFirstName;
+ _RecipientOrganisationOid = pDataContract.RecipientOrganisationOid;
+ _RecipientOrganisation = pDataContract.RecipientOrganisation;
+ _RecipientDivision = pDataContract.RecipientDivision;
+ _RecipientCustomerOid = pDataContract.RecipientCustomerOid;
+ _RecipientCostBearerOid = pDataContract.RecipientCostBearerOid;
+ _RecipientStreet = pDataContract.RecipientStreet;
+ _RecipientAddressLine1 = pDataContract.RecipientAddressLine1;
+ _RecipientTown = pDataContract.RecipientTown;
+ _RecipientPostCode = pDataContract.RecipientPostCode;
+ _IsReviewed = pDataContract.IsReviewed;
+ _IsSent = pDataContract.IsSent;
+ _IsExported = pDataContract.IsExported;
+ _IsPaid = pDataContract.IsPaid;
+ _PartialPayment = pDataContract.PartialPayment;
+ _NeuErstellen = pDataContract.NeuErstellen;
+ _DiffErstellen = pDataContract.DiffErstellen;
+ _InvoiceTitle = pDataContract.InvoiceTitle;
+ _InvoiceNumber = pDataContract.InvoiceNumber;
+ _InvoiceDate = pDataContract.InvoiceDate;
+ _DueDate = pDataContract.DueDate;
+ _CreatorLastName = pDataContract.CreatorLastName;
+ _CreatorFirstName = pDataContract.CreatorFirstName;
+ _AccountingPeriodEnd = pDataContract.AccountingPeriodEnd;
+ _AccountingPeriodStart = pDataContract.AccountingPeriodStart;
+ _Notice = pDataContract.Notice;
+ _DunningLetterCount = pDataContract.DunningLetterCount;
+ _TotalAmount = pDataContract.TotalAmount;
+ _CustomerReferenceNumber = pDataContract.CustomerReferenceNumber;
+ BackgroundColor = pDataContract.BackgroundColor;
+
+ foreach (var iContactDC in pDataContract.SenderContactInformations)
+ {
+ if (iContactDC.ContactType == ContactType.business_Fax)
+ {
+ _SenderFax = iContactDC.ContactValue;
+ }
+
+ if (iContactDC.ContactType == ContactType.business_Phone)
+ {
+ _SenderPhone = iContactDC.ContactValue;
+ }
+ }
+
+ foreach (var iContactDC in pDataContract.RecipientContactInformations)
+ {
+ if (iContactDC.ContactType == ContactType.business_POBox)
+ {
+ _RecipientPostBox = iContactDC.ContactValue;
+ }
+ }
+
+ _InvoiceItems = new InvoiceItemListVM(pDataContract.InvoiceItems);
+
+ IsGkvValid = pDataContract.IsGkvValid;
+ IsGkvValidError = pDataContract.IsGkvValidError;
+ }
+
+ protected override InvoiceBaseDC MapToDataContract(InvoiceBaseDC pDataContract, bool doCommit)
+ {
+ pDataContract.SupportConceptOid = _SupportConceptOid;
+ pDataContract.SenderOrganisation = _SenderOrganisation;
+ pDataContract.SenderLastName = _SenderLastName;
+ pDataContract.SenderFirstName = _SenderFirstName;
+ pDataContract.SenderDivision = _SenderDivision;
+ pDataContract.RecipientPersonOid = _RecipientPersonOid;
+ pDataContract.RecipientPersonLastName = _RecipientPersonLastName;
+ pDataContract.RecipientPersonFirstName = _RecipientPersonFirstName;
+ pDataContract.RecipientOrganisationOid = _RecipientOrganisationOid;
+ pDataContract.RecipientOrganisation = _RecipientOrganisation;
+ pDataContract.RecipientDivision = _RecipientDivision;
+ pDataContract.RecipientCustomerOid = _RecipientCustomerOid;
+ pDataContract.RecipientCostBearerOid = _RecipientCostBearerOid;
+ pDataContract.RecipientPostCode = _RecipientPostCode;
+ pDataContract.RecipientStreet = _RecipientStreet;
+ pDataContract.RecipientAddressLine1 = _RecipientAddressLine1;
+ pDataContract.RecipientTown = _RecipientTown;
+ pDataContract.IsReviewed = _IsReviewed;
+ pDataContract.IsSent = _IsSent;
+ pDataContract.IsExported = _IsExported;
+ pDataContract.IsPaid = _IsPaid;
+ pDataContract.PartialPayment = _PartialPayment;
+ pDataContract.NeuErstellen = _NeuErstellen;
+ pDataContract.DiffErstellen = _DiffErstellen;
+ pDataContract.InvoiceTitle = _InvoiceTitle;
+ pDataContract.InvoiceNumber = _InvoiceNumber;
+ pDataContract.InvoiceDate = _InvoiceDate;
+ pDataContract.DueDate = _DueDate;
+ pDataContract.CreatorLastName = _CreatorLastName;
+ pDataContract.CreatorFirstName = _CreatorFirstName;
+ pDataContract.AccountingPeriodEnd = _AccountingPeriodEnd;
+ pDataContract.AccountingPeriodStart = _AccountingPeriodStart;
+ pDataContract.Notice = _Notice;
+ pDataContract.DunningLetterCount = _DunningLetterCount;
+ pDataContract.TotalAmount = _TotalAmount;
+ pDataContract.CustomerReferenceNumber = _CustomerReferenceNumber;
+
+ CommitSenderContact(_SenderFax, ContactType.business_Fax);
+ CommitSenderContact(_SenderPhone, ContactType.business_Phone);
+ CommitReceiverContact(_RecipientPostBox, ContactType.business_POBox);
+
+ pDataContract.InvoiceItems = _InvoiceItems.CopyToDCList(doCommit);
+
+ return pDataContract;
+ }
+
+ private void CommitSenderContact(string pValue, ContactType pContactType)
+ {
+ var lOldContactDCs = DataContract.SenderContactInformations != null ? DataContract.SenderContactInformations.ToList() : new List();
+ CommitContact(pValue, pContactType, lOldContactDCs);
+
+ DataContract.SenderContactInformations = lOldContactDCs;
+ }
+
+
+ private void CommitReceiverContact(string pValue, ContactType pContactType)
+ {
+ var lOldContactDCs = DataContract.RecipientContactInformations != null ? DataContract.RecipientContactInformations.ToList() : new List();
+ CommitContact(pValue, pContactType, lOldContactDCs);
+
+ DataContract.RecipientContactInformations = lOldContactDCs;
+ }
+
+ private void CommitContact(string pValue, ContactType pContactType, List lOldContactDCs)
+ {
+ var lContactDC = lOldContactDCs.SingleOrDefault(con => con.ContactType == pContactType);
+
+ if (string.IsNullOrEmpty(pValue) && lContactDC != null)
+ {
+ lOldContactDCs.Remove(lContactDC);
+ }
+ else if (!string.IsNullOrEmpty(pValue))
+ {
+ if (lContactDC == null)
+ {
+ lContactDC = new ContactDC
+ {
+ ContactType = pContactType
+ };
+
+ lOldContactDCs.Add(lContactDC);
+ }
+
+ lContactDC.ContactValue = pValue;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/BeWo/ViewModel/OrganisationVM.cs b/BeWo/ViewModel/OrganisationVM.cs
index b0aa4508c..4ac381d1f 100644
--- a/BeWo/ViewModel/OrganisationVM.cs
+++ b/BeWo/ViewModel/OrganisationVM.cs
@@ -770,8 +770,8 @@ namespace BeWo.ViewModel
}
public bool IsIKNumberValid
- => DakotaValidator.ValidateIKNumber(IKKrankenkasse)
- && DakotaValidator.ValidateLeistungserbringergruppe(Leistungserbringergruppe);
+ => DakotaValidator.IsIKNumberValid(IKKrankenkasse)
+ && DakotaValidator.IsLeistungserbringergruppeValid(Leistungserbringergruppe);
public string IKKrankenkasse
{
diff --git a/Dakota/DakotaUtils.cs b/Dakota/DakotaUtils.cs
index c9a789b0d..e5eb342cc 100644
--- a/Dakota/DakotaUtils.cs
+++ b/Dakota/DakotaUtils.cs
@@ -104,7 +104,7 @@ namespace Dakota
if (mandatordc == null)
throw new DakotaException("Mandator ist null");
- if (!DakotaValidator.ValidateIKNumber(mandatordc.IKLeistungserbringer))
+ if (!DakotaValidator.IsIKNumberValid(mandatordc.IKLeistungserbringer))
throw new DakotaException($"Die IK Nummer des Leistungserbringers \"{mandatordc.IKLeistungserbringer}\" ist ungültig.");
}
@@ -117,7 +117,9 @@ namespace Dakota
if (customerDC == null)
error = "Customer ist null";
- else if (!DakotaValidator.ValidateVersichertenstatus(customerDC.VersichertenStatus))
+ else if (!DakotaValidator.IsVersichertennummerValid(customerDC.InsuranceNumber))
+ error = $"Klient/in \"{customerDC.LastName}, {customerDC.FirstName}\" hat keine gültige Versichertennummer";
+ else if (!DakotaValidator.IsVersichertenstatusValid(customerDC.VersichertenStatus))
error = $"Klient/in \"{customerDC.LastName}, {customerDC.FirstName}\" hat keinen gültigen Versichertenstatus";
if (error != null)
@@ -130,13 +132,13 @@ namespace Dakota
if (orga == null)
error = "Organisation ist null";
- else if (!DakotaValidator.ValidateLeistungserbringergruppe(orga.Leistungserbringergruppe))
+ else if (!DakotaValidator.IsLeistungserbringergruppeValid(orga.Leistungserbringergruppe))
error = $"Die Organisation \"{orga.Name}\" hat keine gültige Leistungserbringergruppe: \"{orga.Leistungserbringergruppe}\". Erwarten werden 5 Stellen für das Tarifkennzeichen alleine oder 7 Stellen für den Abrechnungscode und für das Tarifkennzeichen zusammen.";
- else if (!DakotaValidator.ValidateIKNumber(orga.IKKrankenkasse))
+ else if (!DakotaValidator.IsIKNumberValid(orga.IKKrankenkasse))
error = $"Die Organisation \"{orga.Name}\" hat kein gültiges IK Krankenkasse Kennzeichen: \"{orga.IKKrankenkasse}\".";
- else if (!DakotaValidator.ValidateIKNumber(orga.IKKostentrager))
+ else if (!DakotaValidator.IsIKNumberValid(orga.IKKostentrager))
error = $"Die Organisation \"{orga.Name}\" hat kein gültiges IK Kostenträger Kennzeichen: \"{orga.IKKostentrager}\".";
- else if (!DakotaValidator.ValidateIKNumber(orga.IKDatenannahmestelle))
+ else if (!DakotaValidator.IsIKNumberValid(orga.IKDatenannahmestelle))
error = $"Die Organisation \"{orga.Name}\" hat kein gültiges IK Datenannahmestelle Kennzeichen: \"{orga.IKDatenannahmestelle}\".";
if (error != null)
diff --git a/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs b/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs
index 8e6c5156f..f93c4d34f 100644
--- a/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs
+++ b/Service/DCEntityMapper/InvoiceBaseDC_InvoiceBase.cs
@@ -124,12 +124,12 @@ namespace BeWo.Service.DCEntityMapper
pDataContract.TotalAmount = pDataContract.InvoiceItems.Sum(i => i.AmountTotal);
}
+ Customer customer = null;
if(pEntity.CostBearer2SupportConcept!=null)
{
try
{
- pDataContract.CustomerFirstName = pEntity.CostBearer2SupportConcept.SupportConcept.Customer.Person.FirstName;
- pDataContract.CustomerLastName = pEntity.CostBearer2SupportConcept.SupportConcept.Customer.Person.LastName;
+ customer = pEntity.CostBearer2SupportConcept.SupportConcept.Customer;
}
catch (Exception)
{
@@ -140,8 +140,16 @@ namespace BeWo.Service.DCEntityMapper
else if (pEntity.SupportConceptOid.HasValue)
{
SupportConcept sc = DAOFactory.GenericDAO.LoadByID(pEntity.SupportConceptOid.Value);
- pDataContract.CustomerFirstName = sc.Customer.Person.FirstName;
- pDataContract.CustomerLastName = sc.Customer.Person.LastName;
+ customer = sc.Customer;
+ }
+
+ if(customer is object)
+ {
+ pDataContract.CustomerFirstName = customer.Person.FirstName;
+ pDataContract.CustomerLastName = customer.Person.LastName;
+ var error = DakotaValidator.ValidateCustomer(customer.InsuranceNumber, customer.VersichertenStatus);
+ pDataContract.IsGkvValidError = error;
+ pDataContract.IsGkvValid = error is null;
}
return pDataContract;
diff --git a/Service/ServiceImplementations/AccountingServiceImp.cs b/Service/ServiceImplementations/AccountingServiceImp.cs
index a85afbdfa..880fa8332 100644
--- a/Service/ServiceImplementations/AccountingServiceImp.cs
+++ b/Service/ServiceImplementations/AccountingServiceImp.cs
@@ -941,7 +941,7 @@ namespace BeWo.Service.ServiceImplementations
DakotaUtils.ValidateOrganisation(orga);
- if (!DakotaValidator.ValidateOrganisationInformations(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle))
+ if (!DakotaValidator.IsOrganisationInformationValid(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle))
{
var res = SendApp8GetIKRequest(orga);
@@ -957,7 +957,7 @@ namespace BeWo.Service.ServiceImplementations
orga.IKKostentrager = res.IKKostentrager;
orga.BezDatenannahmestelle = res.BezDatenannahmestelle;
- if (!DakotaValidator.ValidateOrganisationInformations(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle))
+ if (!DakotaValidator.IsOrganisationInformationValid(orga.IKDatenannahmestelle, orga.IKKostentrager, orga.IKKrankenkasse, orga.BezDatenannahmestelle))
throw new DakotaException($"Für die Organisation \"{orga.Name}\" konnten die hinterlegten IKs nicht verifiziert werden: \"{orga.BezDatenannahmestelle}\", \"{orga.IKDatenannahmestelle}\", \"{orga.IKKostentrager}\", \"{orga.IKKrankenkasse}\"", "Interner Fehler");
DAOFactory.GenericDAO.Update(orga);
diff --git a/Shared/Core/DakotaValidator.cs b/Shared/Core/DakotaValidator.cs
index cbde77d41..09076489a 100644
--- a/Shared/Core/DakotaValidator.cs
+++ b/Shared/Core/DakotaValidator.cs
@@ -10,14 +10,16 @@ namespace BS.Shared.Core
{
public static class DakotaValidator
{
- public static bool ValidateMandator(string ik_leistungserbringer)
- => ValidateIKNumber(ik_leistungserbringer);
- public static bool ValidateOrganisationInformations(string ik_datenannahmestelle, string ik_kostentrager, string ik_krankenkasse, string bez_datenannahmestelle)
- => ValidateIKNumber(ik_datenannahmestelle, ik_kostentrager, ik_krankenkasse) && !string.IsNullOrEmpty(bez_datenannahmestelle);
- public static bool ValidateIKNumber(params string[] iks)
- => iks?.All(ValidateIKNumber) ?? false;
+ public static bool IsMandatorValid(string ik_leistungserbringer)
+ => IsIKNumberValid(ik_leistungserbringer);
+ public static bool IsOrganisationInformationValid(string ik_datenannahmestelle, string ik_kostentrager, string ik_krankenkasse, string bez_datenannahmestelle)
+ => IsIKNumberValid(ik_datenannahmestelle, ik_kostentrager, ik_krankenkasse) && !string.IsNullOrEmpty(bez_datenannahmestelle);
+ public static bool IsCustomerValid(string insurance_number, string insurance_status)
+ => IsVersichertennummerValid(insurance_number) && IsVersichertenstatusValid(insurance_status);
+ public static bool IsIKNumberValid(params string[] iks)
+ => iks?.All(IsIKNumberValid) ?? false;
- public static bool ValidateIKNumber(string iknummer)
+ public static bool IsIKNumberValid(string iknummer)
{
if (iknummer == null)
return false;
@@ -28,7 +30,18 @@ namespace BS.Shared.Core
return int.TryParse(iknummer, out int x);
}
- public static bool ValidateVersichertenstatus(string status)
+ public static bool IsVersichertennummerValid(string nummer)
+ {
+ if (nummer == null)
+ return false;
+
+ if (nummer.Length < 10)
+ return false;
+
+ return true;
+ }
+
+ public static bool IsVersichertenstatusValid(string status)
{
if (status == null)
return false;
@@ -39,7 +52,7 @@ namespace BS.Shared.Core
return true;
}
- public static bool ValidateLeistungserbringergruppe(string code)
+ public static bool IsLeistungserbringergruppeValid(string code)
{
if (code == null)
return false;
@@ -49,5 +62,20 @@ namespace BS.Shared.Core
return true;
}
- }
+
+ public static string ValidateCustomer(string insuranceNumber, string versichertenStatus)
+ {
+ bool valid_number = IsVersichertennummerValid(insuranceNumber);
+ bool valid_status = IsVersichertenstatusValid(versichertenStatus);
+
+ if (!valid_number && !valid_status)
+ return "Versichtertennummer & -status ungültig.";
+ else if (!valid_number)
+ return "Versichertennummer ungültig";
+ else if (!valid_status)
+ return "Versichertenstatus ungültig";
+
+ return null;
+ }
+ }
}
diff --git a/Shared/DataContracts/InvoiceBaseDC.cs b/Shared/DataContracts/InvoiceBaseDC.cs
index 0c8687967..00a6b73d2 100644
--- a/Shared/DataContracts/InvoiceBaseDC.cs
+++ b/Shared/DataContracts/InvoiceBaseDC.cs
@@ -25,6 +25,12 @@ namespace BS.Shared.DataContracts
[DataMember]
public string CreatorLastName { get; set; }
+ [DataMember]
+ public bool IsGkvValid { get; set; }
+
+ [DataMember]
+ public string IsGkvValidError { get; set; }
+
[DataMember]
public string CustomerFirstName { get; set; }